From d552c698def75056fbf76c172b87b637d3d8c05c Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 6 Aug 2013 20:12:02 +0000 Subject: [PATCH] Improve Env#output spec: Test the receiving output object state instead of expecting that it will receive a specific message. --- spec/producer/core/env_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/producer/core/env_spec.rb b/spec/producer/core/env_spec.rb index a07a4e9..94699f0 100644 --- a/spec/producer/core/env_spec.rb +++ b/spec/producer/core/env_spec.rb @@ -30,12 +30,12 @@ module Producer::Core end 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 - env.output = standard_output - expect(standard_output).to receive(:puts).with('some content') + env.output = stdout env.output 'some content' + expect(stdout.string).to eq "some content\n" end end