fedora-migrator /vendor/gems/facets-2.4.5/test/core/kernel/test_deepcopy.rb

Language Ruby Lines 28
MD5 Hash 7a5806d93aeba5e3588556b4b6fa39a1 Estimated Cost $468 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'facets/kernel/deep_copy.rb'
require 'test/unit'

class TestKernelCopy < Test::Unit::TestCase

  # fixtures for copy / deep_copy
  class A
    attr_reader :a
    def initialize
      @a = 1
    end
  end

  class B
    attr_reader :b
    def initialize
      @b = A.new
    end
  end

  def test_deep_copy
    o = B.new
    oc = o.deep_copy
    assert_equal( 1, o.b.a  )
  end

end
Back to Top