Permalink
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...
jnunemaker committed Jan 11, 2010
1 parent 6024094 commit d6096a5cac1b2af85e77d0b7b74e8c355af2d6d1
Showing with 12 additions and 5 deletions.
  1. +0 −1 lib/mongo_mapper/document.rb
  2. +12 −4 test/functional/test_identity_map.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
@@ -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

0 comments on commit d6096a5

Please sign in to comment.