1
require_relative 'helper'
4
class TestSerializeSubclasses < TestCase
6
def initialize one, two
12
@one == other.instance_eval { @one } &&
13
@two == other.instance_eval { @two }
18
so = SomeObject.new('foo', [1,2,3])
19
assert_equal so, Psych.load(Psych.dump(so))
22
class StructSubclass < Struct.new(:foo)
23
def initialize foo, bar
29
super(other) && @bar == other.instance_eval{ @bar }
33
def test_struct_subclass
34
so = StructSubclass.new('foo', [1,2,3])
35
assert_equal so, Psych.load(Psych.dump(so))