mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@d6921ef
This commit is contained in:
parent
207a5a5bc1
commit
a6c6eef04a
44 changed files with 1141 additions and 250 deletions
18
spec/ruby/library/set/initialize_clone_spec.rb
Normal file
18
spec/ruby/library/set/initialize_clone_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require_relative '../../spec_helper'
|
||||
require 'set'
|
||||
|
||||
describe "Set#initialize_clone" do
|
||||
ruby_version_is "3.0" do
|
||||
# See https://bugs.ruby-lang.org/issues/14266
|
||||
it "does not freeze the new Set when called from clone(freeze: false)" 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
|
Loading…
Add table
Add a link
Reference in a new issue