Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Identity map is not quite ready for the rest of the tests. Pulling it…

… out of document and instead adding it only to the spots where I'm testing identity map.
  • Loading branch information...
commit d6096a5cac1b2af85e77d0b7b74e8c355af2d6d1 1 parent 6024094
@jnunemaker jnunemaker authored
View
1  lib/mongo_mapper/document.rb
@@ -22,7 +22,6 @@ def self.included(model)
plugin Plugins::Serialization
plugin Plugins::Validations
plugin Plugins::Callbacks # for now callbacks needs to be after validations
- plugin Plugins::IdentityMap
extend Plugins::Validations::DocumentMacros
end
View
16 test/functional/test_identity_map.rb
@@ -13,16 +13,24 @@ def assert_not_in_map(resource)
context "Document" do
setup do
- @person_class = Doc('Person') { key :name, String }
- @post_class = Doc('Post') { key :title, String }
+ @person_class = Doc('Person') do
+ key :name, String
+ plugin MongoMapper::Plugins::IdentityMap
+ end
+
+ @post_class = Doc('Post') do
+ key :title, String
+ plugin MongoMapper::Plugins::IdentityMap
+ end
@person_class.identity_map = {}
@post_class.identity_map = {}
end
should "default identity map to hash" do
- map = Doc().identity_map
- map.should == {}
+ Doc() do
+ plugin MongoMapper::Plugins::IdentityMap
+ end.identity_map.should == {}
end
should "share identity map with other classes" do
Please sign in to comment.
Something went wrong with that request. Please try again.