diff options
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/kernel/clone_spec.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/ruby/core/kernel/clone_spec.rb b/spec/ruby/core/kernel/clone_spec.rb index f20ea618b5..1bbef64f85 100644 --- a/spec/ruby/core/kernel/clone_spec.rb +++ b/spec/ruby/core/kernel/clone_spec.rb @@ -37,11 +37,17 @@ describe "Kernel#clone" do o3.frozen?.should == true end - it 'takes an option to copy freeze state or not' do - @obj.clone(freeze: true).frozen?.should == false + ruby_version_is '2.8' do + it 'takes an freeze: true option to frozen copy' do + @obj.clone(freeze: true).frozen?.should == true + @obj.freeze + @obj.clone(freeze: true).frozen?.should == true + end + end + + it 'takes an freeze: false option to not return frozen copy' do @obj.clone(freeze: false).frozen?.should == false @obj.freeze - @obj.clone(freeze: true).frozen?.should == true @obj.clone(freeze: false).frozen?.should == false end |