Skip to content

Commit

Permalink
Fix Mongoid tests not writing out to a log file for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
obrie committed Mar 12, 2013
1 parent 76a6a08 commit 38f796e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion test/unit/integrations/mongoid_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38f796e

Please sign in to comment.