Permalink
Browse files

Use mongo client and don't attempt to fudge with system collections.

  • Loading branch information...
1 parent 7f49ca2 commit 3ba426faf35c86568fe872e53bb3dc748c6b0e5b @jnunemaker jnunemaker committed Mar 14, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 spec/helper.rb
View
@@ -17,7 +17,7 @@
LogBuddy.init :logger => Log
-connection = Mongo::Connection.new('127.0.0.1', 27017, :logger => Log)
+connection = Mongo::MongoClient.new('127.0.0.1', 27017, :logger => Log)
DB = connection.db('test')
RSpec.configure do |config|
@@ -27,15 +27,15 @@
config.run_all_when_everything_filtered = true
config.before(:suite) do
- DB.collections.map do |collection|
- collection.drop_indexes
- end
+ DB.collections.reject { |collection|
+ collection.name =~ /system\./
+ }.map(&:drop_indexes)
end
config.before(:each) do
- DB.collections.map do |collection|
- collection.remove
- end
+ DB.collections.reject { |collection|
+ collection.name =~ /system\./
+ }.map(&:remove)
end
end

0 comments on commit 3ba426f

Please sign in to comment.