Permalink
Browse files

Fix Mongoid tests not writing out to a log file for debugging

  • Loading branch information...
1 parent 76a6a08 commit 38f796e35781a743a399910a7085d7df94253b11 @obrie obrie committed Mar 12, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −4 .gitignore
  2. +4 −1 test/unit/integrations/mongoid_test.rb
View
@@ -4,8 +4,5 @@
.yardoc/
coverage/
/doc/
-test/active_record.log
-test/data_mapper.log
-test/mongo_mapper.log
-test/sequel.log
+test/*.log
/Gemfile.lock
@@ -6,12 +6,15 @@
# Establish database connection
Mongoid.configure do |config|
if Mongoid::VERSION =~ /^2\./
- config.master = Mongo::Connection.new('127.0.0.1', 27017, :slave_ok => true).db('test')
+ connection = Mongo::Connection.new('127.0.0.1', 27017, :slave_ok => true, :logger => Logger.new("#{File.dirname(__FILE__)}/../../mongoid.log"))
+ config.master = connection.db('test')
else
+ Mongoid.logger = Moped.logger = Logger.new("#{File.dirname(__FILE__)}/../../mongoid.log")
config.connect_to('test')
end
end
+
module MongoidTest
class BaseTestCase < Test::Unit::TestCase
def default_test

0 comments on commit 38f796e

Please sign in to comment.