Print a warning when in dry run mode

This commit is contained in:
Thibault Jouan
2014-07-01 18:15:55 +00:00
parent aac5f603e3
commit 1188b2008f
7 changed files with 52 additions and 7 deletions

View File

@@ -113,8 +113,8 @@ module Producer::Core
expect(output.string).to include 'some message'
end
it 'has a log level of ERROR' do
expect(env.logger.level).to eq Logger::ERROR
it 'has a log level of WARN' do
expect(env.logger.level).to eq Logger::WARN
end
it 'uses our formatter' do
@@ -135,6 +135,13 @@ module Producer::Core
expect(env.logger).to receive(:info).with 'message'
env.log 'message'
end
context 'when second argument is :warn' do
it 'logs a warning message through the assigned logger' do
expect(env.logger).to receive(:warn).with 'message'
env.log 'message', :warn
end
end
end
describe '#verbose?' do