Skip to content

Commit

Permalink
Merge pull request #5 from nashby/patch-2
Browse files Browse the repository at this point in the history
use let instead of iVar
  • Loading branch information
antono committed Apr 2, 2012
2 parents fc43bea + c2effc0 commit 2ff3ed3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/shelr/publisher_spec.rb
Expand Up @@ -26,15 +26,16 @@
end

describe "#dump(id)" do
let(:file) { mock('dump file') }

before do
@file = mock('dump file')
File.stub(:open).and_yield @file
File.stub(:open).and_yield file
end

it "saves prepared dump to #dump_filename" do
File.should_receive(:open).with(subject.send(:dump_filename), 'w+')
subject.should_receive(:prepare).with('hello').and_return('dump')
@file.should_receive(:puts).with('dump')
file.should_receive(:puts).with('dump')
subject.dump('hello')
end
end
Expand Down

0 comments on commit 2ff3ed3

Please sign in to comment.