spec/amf/class_mapping_spec.rb in rack-amf-0.0.1 vs spec/amf/class_mapping_spec.rb in rack-amf-0.0.2
- old
+ new
@@ -90,9 +90,20 @@
hash = @mapper.props_for_serialization obj
hash.should == {'prop_a' => 'Test A', 'prop_b' => 'Test B', 'prop_c' => nil}
end
+ it "should extract inherited object properties" do
+ class RubyClass2 < RubyClass
+ end
+ obj = RubyClass2.new
+ obj.prop_a = 'Test A'
+ obj.prop_b = 'Test B'
+
+ hash = @mapper.props_for_serialization obj
+ hash.should == {'prop_a' => 'Test A', 'prop_b' => 'Test B', 'prop_c' => nil}
+ end
+
it "should allow custom serializers" do
class CustomSerializer
def can_handle? obj
true
end
\ No newline at end of file