From 5a2835a5309a54397347f484500ff4df3004da93 Mon Sep 17 00:00:00 2001 From: Wender Freese Date: Wed, 6 Oct 2021 14:56:09 -0300 Subject: [PATCH] Add specs to cover the fix for [Bug #14266] --- library/set/clone_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 library/set/clone_spec.rb diff --git a/library/set/clone_spec.rb b/library/set/clone_spec.rb new file mode 100644 index 0000000000..3cd4932ea3 --- /dev/null +++ b/library/set/clone_spec.rb @@ -0,0 +1,17 @@ +require_relative '../../spec_helper' +require 'set' + +describe "Set#clone" do + ruby_version_is "3.0" do + it "does not freeze the new Set" do + set1 = Set[1, 2] + set1.freeze + set2 = set1.clone(freeze: false) + set1.frozen?.should == true + set2.frozen?.should == false + set2.add 3 + set1.should == Set[1, 2] + set2.should == Set[1, 2, 3] + end + end +end