Sha256: 114cdff909009a9966c9d470c1c79b7bec33fd6e28c996b38d7f3fdae7fc5530
Contents?: true
Size: 433 Bytes
Versions: 31
Compression:
Stored size: 433 Bytes
Contents
describe "Array#clone" do it "produces a shallow copy where the references are directly copied" do a = [mock('1'), mock('2')] b = a.clone b.first.object_id.should == a.first.object_id b.last.object_id.should == a.last.object_id end it "creates a new array containing all the elements of the original" do a = [1, 2, 3, 4] b = a.clone b.should == a b.object_id.should_not == a.object_id end end
Version data entries
31 entries across 31 versions & 1 rubygems