Sha256: d57545dfe90ec059a938f6490ba169f58a4b65367b16f1c32a95cae95ded0e76

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

#
# Testing OpenWFEru
#
# John Mettraux at openwfe.org
#

require 'test/unit'

require 'openwfe/utils'


class FullDupTest < Test::Unit::TestCase

    #def setup
    #end

    #def teardown
    #end

    class MyClass

        attr_reader :name

        def initialize (name)
            @name = name
        end
    end

    def test_fulldup

        o0 = MyClass.new("cow")

        o1 = OpenWFE.fulldup(o0)

        assert_not_equal o0.object_id, o1.object_id
        assert_equal o0.name, o1.name
    end

    def test_yaml

        require 'yaml'

        o0 = MyClass.new("pig")
        o1 = YAML.load(o0.to_yaml)

        assert_not_equal o0.object_id, o1.object_id
        assert_equal o0.name, o1.name
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openwferu-0.9.14 test/clone_test.rb
openwferu-0.9.15 test/clone_test.rb