Skip to content

Commit

Permalink
Fix 1.9 test failures in json serializer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Aug 29, 2010
1 parent abf2168 commit 4c27da2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/unit/serializers/test_json_serializer.rb
Expand Up @@ -25,12 +25,10 @@ class Contact
many :tags, :class_name => 'JsonSerializationTest::Tag'
end

class ::TopLevelContact
include MongoMapper::Document
key :name, String
end

def setup
Kernel.const_set('TopLevelContact', Doc('TopLevelContact'))
TopLevelContact.key :name, String

Contact.include_root_in_json = false
@contact = Contact.new(
:name => 'Konata Izumi',
Expand All @@ -45,7 +43,7 @@ def setup
end

def teardown
Kernel.send(:remove_const, 'TopLevelContact') if Kernel.const_defined?('TopLevelContact')
Kernel.send(:remove_const, 'TopLevelContact') if Object.const_defined?('TopLevelContact')
end

should "include root for class with no module" do
Expand Down

0 comments on commit 4c27da2

Please sign in to comment.