Improve Env#output spec:

Test the receiving output object state instead of expecting that it
will receive a specific message.
This commit is contained in:
Thibault Jouan 2013-08-06 20:12:02 +00:00
parent 31b9e68026
commit d552c698de

View File

@ -30,12 +30,12 @@ module Producer::Core
end end
describe '#output' do describe '#output' do
let(:standard_output) { StringIO.new } let(:stdout) { StringIO.new }
it 'writes the given string to the assigned IO with a record separator' do it 'writes the given string to the assigned IO with a record separator' do
env.output = standard_output env.output = stdout
expect(standard_output).to receive(:puts).with('some content')
env.output 'some content' env.output 'some content'
expect(stdout.string).to eq "some content\n"
end end
end end