Created
December 30, 2009 19:51
-
-
Save phinze/266335 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
Feature: Dashboard | |
In order to not explode from frustration | |
a developer | |
does not want rspec stubs to leak between scenarios | |
Scenario: Create a stub | |
When I stub nap time to "When I Get Cranky" | |
Then nap time should be "When I Get Cranky" | |
Scenario: Check to see if the stub leaked | |
Then nap time should not be defined |
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
When /^I stub nap time to "([^\"]*)"$/ do |value| | |
Time.stub!(:nap).and_return(value) | |
end | |
Then /^nap time should be "([^\"]*)"$/ do |value| | |
Time.nap.should == value | |
end | |
Then /^nap time should not be defined$/ do | |
lambda { | |
Time.nap | |
}.should raise_error(NoMethodError) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment