spec/support/mongoid.rb in mongoid-history-0.3.3 vs spec/support/mongoid.rb in mongoid-history-0.4.0
- old
+ new
@@ -1,17 +1,15 @@
-ENV["MONGOID_ENV"] = "test"
-Mongoid.load!("config/mongoid.yml")
+Mongoid.configure do |config|
+ config.connect_to('mongoid_history_test')
+end
RSpec.configure do |config|
config.before :each do
Mongoid.observers = Mongoid::History::Sweeper
end
- config.backtrace_clean_patterns = [
- # /\/lib\d*\/ruby\//,
- # /bin\//,
- # /gems/,
- # /spec\/spec_helper\.rb/,
- /lib\/rspec\/(core|expectations|matchers|mocks)/
- ]
-end
+ config.after(:each) do
+ Mongoid.purge!
+ end
+ config.backtrace_clean_patterns = [ /lib\/rspec\/(core|expectations|matchers|mocks)/ ]
+end
\ No newline at end of file