Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Use RSpec's append_after method instead of calling a db_teardown method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Crosby-McCullough committed Apr 12, 2010
1 parent 79cb1a7 commit e6fae52
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 13 deletions.
2 changes: 0 additions & 2 deletions integration/basic_storage_cycle_spec.rb
Expand Up @@ -35,6 +35,4 @@ class Article
article.delete!
Article.find.should be_empty
end

db_teardown
end
2 changes: 0 additions & 2 deletions integration/cross_collection_relationships_spec.rb
Expand Up @@ -24,6 +24,4 @@ class Person
it "retains a reference to the embedded document in its container document." do
Article.find.first.author.should == @dave
end

db_teardown
end
2 changes: 0 additions & 2 deletions integration/dynamic_finders_spec.rb
Expand Up @@ -28,6 +28,4 @@ class Article
Article.find_by_precis('A study in geological fluid physics').first.should == @geology_article
end
end

db_teardown
end
4 changes: 1 addition & 3 deletions integration/meta_spec.rb
@@ -1,8 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/support/integration_helper')

describe 'Integration tests' do
db_teardown

describe 'Each integration test' do
before(:each) do
class Integration
include LightMongo::Document
Expand Down
2 changes: 0 additions & 2 deletions integration/object_embedding_spec.rb
Expand Up @@ -37,6 +37,4 @@ class Comment
stored_comment.author_name.should == @comment.author_name
stored_comment.text.should == @comment.text
end

db_teardown
end
4 changes: 2 additions & 2 deletions integration/support/integration_helper.rb
Expand Up @@ -2,8 +2,8 @@

LightMongo.database = 'light_mongo_test'

def db_teardown
after(:each) do
Spec::Runner.configure do |config|
config.append_after(:each) do
LightMongo.connection.drop_database(LightMongo.database.name)
end
end

0 comments on commit e6fae52

Please sign in to comment.