Created
August 1, 2012 19:01
-
-
Save johnwake/3229812 to your computer and use it in GitHub Desktop.
BDD Cucumber example Feature File
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: greeter says hello | |
In order to start learning RSpec and Cucumber | |
As a reader of The RSpec Book | |
I want a greeter to say Hello | |
Scenario: Greeter says hello | |
Given a greeter | |
When I send it the greet message | |
Then I should see "Hello Cucumber!" |
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 CucumberGreeter | |
def greet | |
"Hello Cucumber!" | |
end | |
end | |
Given /^a greeter$/ do | |
@greeter = CucumberGreeter.new | |
end | |
When /^I send it the greet message$/ do | |
@message = @greeter.greet | |
end | |
Then /^I should see "([^"]*)"$/ do |greeting| | |
@message.should == greeting | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment