Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use RSpec's append_after method instead of calling a db_teardown method.

  • Loading branch information...
commit e6fae526c8ebb4fdbd3fb7285183aebba0f4db74 1 parent 79cb1a7
Elliot Crosby-McCullough authored
View
2  integration/basic_storage_cycle_spec.rb
@@ -35,6 +35,4 @@ class Article
article.delete!
Article.find.should be_empty
end
-
- db_teardown
end
View
2  integration/cross_collection_relationships_spec.rb
@@ -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
View
2  integration/dynamic_finders_spec.rb
@@ -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
View
4 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
View
2  integration/object_embedding_spec.rb
@@ -37,6 +37,4 @@ class Comment
stored_comment.author_name.should == @comment.author_name
stored_comment.text.should == @comment.text
end
-
- db_teardown
end
View
4 integration/support/integration_helper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.