Sha256: 3dd55af745021aa9535eb885663eab24268b76c4f612609b9427f92d61e99a5b
Contents?: true
Size: 664 Bytes
Versions: 17
Compression:
Stored size: 664 Bytes
Contents
require 'facets/cloneable' require 'test/unit' class Foo include Cloneable def initialize @bar=[] end def bar_id @bar.object_id end end class TestCloneable < Test::Unit::TestCase def test_dup a=Foo.new b=a.dup assert_not_equal a.bar_id,b.bar_id a.taint b=a.dup assert b.tainted?, "b should be tainted" a.freeze b=a.dup assert !b.frozen?, "b should not be frozen" end def test_clone a=Foo.new b=a.clone assert_not_equal a.bar_id,b.bar_id a.taint b=a.dup assert b.tainted?, "b should be tainted" a.freeze b=a.clone assert b.frozen?, "b should be frozen" end end
Version data entries
17 entries across 17 versions & 1 rubygems