spec/amf/deserializer_spec.rb in rack-amf-0.0.2 vs spec/amf/deserializer_spec.rb in rack-amf-0.0.3

- old
+ new

@@ -1,8 +1,12 @@ require File.dirname(__FILE__) + '/../spec_helper.rb' describe "when deserializing" do + before :each do + AMF::ClassMapper.reset + end + describe "AMF0" do it "should deserialize numbers" do input = object_fixture('amf0-number.bin') output = AMF.deserialize(input, 0) output.should == 3.5 @@ -56,14 +60,22 @@ input = object_fixture('amf0-ecma-ordinal-array.bin') output = AMF.deserialize(input, 0) output.should == ['a', 'b', 'c', 'd'] end + it "should serialize strict arrays" do + input = object_fixture('amf0-strict-array.bin') + output = AMF.deserialize(input, 0) + output.should == ['a', 'b', 'c', 'd'] + end + it "should deserialize dates" do input = object_fixture('amf0-date.bin') output = AMF.deserialize(input, 0) output.should == Time.utc(2003, 2, 13, 5) end + + it "should deserialize XML" it "should deserialize an unmapped object as a dynamic anonymous object" do input = object_fixture("amf0-typed-object.bin") output = AMF.deserialize(input, 0) \ No newline at end of file