Created
March 16, 2015 21:37
-
-
Save kaiwren/4f724b9e736bf3bca525 to your computer and use it in GitHub Desktop.
object dup_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../../../spec_helper', __FILE__) | |
require File.expand_path('../shared/dup_clone', __FILE__) | |
describe "Object#clone" do | |
it_behaves_like :object_dup_clone, :clone | |
it "preserves frozen state from the original" do | |
o = ObjectSpecDupInitCopy.new | |
o2 = o.clone | |
o.freeze | |
o3 = o.clone | |
o2.frozen?.should == false | |
o3.frozen?.should == true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../../../spec_helper', __FILE__) | |
require File.expand_path('../shared/dup_clone', __FILE__) | |
describe "Object#dup" do | |
it_behaves_like :object_dup_clone, :dup | |
it "does not preserve frozen state from the original" do | |
o = ObjectSpecDupInitCopy.new | |
o.freeze | |
o2 = o.dup | |
o2.frozen?.should == false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment