Created
October 11, 2010 15:18
-
-
Save lukeredpath/620673 to your computer and use it in GitHub Desktop.
This file contains 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 SMSTester | |
def initialize | |
@number_of_sms = 0 | |
@number_expected = 0 | |
end | |
def should_have_received_message_containing | |
@number_expected += 1 | |
# do something that might send an SMS | |
@number_of_sms_sent += # introspect this somehow? | |
end | |
end | |
Given /I do something that sends an SMS/ do | |
@sms_tester = SMSTester.new | |
@sms_tester.do_something | |
end | |
When /I do something again/ do | |
@sms_tester.do_something | |
end | |
Then /I should receive an SMS containing blah blah/ do |msg| | |
@sms_tester.should_have_received_message_containing(msg) | |
end | |
Then /I should not have received another SMS/ do | |
assert @sms_tester.number_of_sms_sent < @sms_tester.number_expected | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment