elliotcm / light_mongo

A lightweight Ruby object persistence library for Mongo DB.
MIT License
81 stars 4 forks source link

ruby 1.9 #1

Open reactormonk opened 14 years ago

reactormonk commented 14 years ago

Ehm.

  1)
  'LightMongo::Document::Serialization#export if Persistence has been included generates a hash of its class name and id' FAILED
  expected: {"_class_name"=>"TestClass", "_id"=>#<Spec::Mocks::Mock:0x18c34e8 @name=:id>},
       got: {"_class_name"=>"#<Class:0x000000031a4678>::TestClass", "_id"=>#<Spec::Mocks::Mock:0x18c34e8 @name=:id>} (using ==)
  /tmp/light_mongo/spec/document/serialization_spec.rb:34:in `block (4 levels) in <top (required)>'

  2)
  NoMethodError in 'LightMongo::Document::Serialization::HashSerializer.serialize_object(object_to_serialize, current_depth) when a non-primitive non-LightMongo::Document object hashifies the object'
  undefined method `sub' for :@name:Symbol
  /tmp/light_mongo/spec/document/serialization/hash_serializer_spec.rb:31:in `block (5 levels) in <top (required)>'

  3)
  'LightMongo::Document::Serialization::HashSerializer.serialize_object(object_to_serialize, current_depth) when a non-primitive LightMongo::Document object when below the top level exports the object' FAILED
  expected: {"_class_name"=>"TestClass", "_id"=>#<Spec::Mocks::Mock:0x17f04b8 @name=:id>},
       got: {"_class_name"=>"#<Class:0x00000002feccc8>::TestClass", "_id"=>#<Spec::Mocks::Mock:0x17f04b8 @name=:id>} (using ==)
  /tmp/light_mongo/spec/document/serialization/hash_serializer_spec.rb:53:in `block (6 levels) in <top (required)>'

~

elliotcm commented 14 years ago

Error 2 is some cross-chatter between spec files I haven't been able to pin down. If you run that file on its own it should pass.

For the other two, looks like Ruby1.9 handles instance.class.name differently. Interesting.