-
-
Save mrkn/1885314 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def hi; end | |
def bar | |
hi if @flag | |
@flag = true | |
end | |
end | |
describe 'some' do | |
subject { Foo.new } | |
context 'bar has not yet been received' do | |
it 'does not receive hi' do | |
subject.should_not_receive(:hi) | |
subject.bar | |
end | |
end | |
context 'bar has already been received once' do | |
before do | |
subject.bar | |
end | |
it 'receives hi' do | |
subject.should_receive(:hi) | |
subject.bar | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment