Skip to content

Commit

Permalink
Add specs to cover the fix for [Bug #14266]
Browse files Browse the repository at this point in the history
  • Loading branch information
wenderjean committed Oct 6, 2021
1 parent 9597d4b commit 5a2835a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions library/set/clone_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5a2835a

Please sign in to comment.