Skip to content

Commit

Permalink
silence logs in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pewniak747 committed Sep 13, 2013
1 parent baca277 commit dcadea9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/integration/hipbot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

before do
Hipbot.bot.configuration.user = Hipbot::User.create(name: 'robbot')
Hipbot.bot.configuration.logger = NullLogger.instance
end

describe 'configuration' do
Expand Down
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@

RSpec.configure do |config|
config.mock_with :mocha

config.before(:all) do
Hipbot::Bot.instance.configuration.logger = NullLogger.instance
end
end

class NullLogger
def self.instance
Logger.new('/dev/null')
end
end
1 change: 1 addition & 0 deletions spec/unit/hipbot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

before(:each) do
described_class.instance.plugins.clear
described_class.instance.configuration.logger = NullLogger.instance
described_class.instance.setup
end
subject { described_class.instance }
Expand Down

0 comments on commit dcadea9

Please sign in to comment.