Skip to content

Instantly share code, notes, and snippets.

@kaiwren
Created March 16, 2015 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaiwren/4f724b9e736bf3bca525 to your computer and use it in GitHub Desktop.
Save kaiwren/4f724b9e736bf3bca525 to your computer and use it in GitHub Desktop.
object dup_spec.rb
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
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