Created
November 24, 2012 04:53
-
-
Save kris-luminar/4138456 to your computer and use it in GitHub Desktop.
Ambiguous match of "its name is Fred":
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: Puppies are very cute and everyone wants one | |
In order to make everyone happy | |
As a puppy class programmer | |
I want to give everyone a cute virtual puppy | |
Scenario: The puppy is being pet | |
Given we have a puppy | |
And its name is Fred | |
When we pet the puppy | |
Then the puppy wags its tail | |
Scenario: The puppy needs to go out | |
Given we have a puppy | |
And its name is Bella | |
When we ring the bell | |
And it wags its tail | |
Then we must take it out | |
And then it will not pee on the floor |
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 Puppy | |
attr_accessor :name | |
def initialize | |
end | |
def pet | |
wag | |
end | |
protected | |
def wag | |
"the puppy wags its tail" | |
end | |
end |
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
Given /^we have a puppy$/ do | |
@puppy = Puppy.new | |
end | |
Given /^its name is (\w+)$/ do |arg1| | |
@puppy.name = arg1 | |
@puppy.name == arg1 | |
end | |
When /^we pet the puppy$/ do | |
@result = @puppy.pet | |
end | |
Then /^the puppy wags its tail$/ do | |
@result.should eq "the puppy wags its tail" | |
end | |
Given /^its name is (\w+)$/ do |arg1| | |
@puppy = Puppy.new | |
@puppy.name = arg1 | |
@puppy.name.should eq arg1 | |
end | |
When /^we ring the bell$/ do | |
@result = @puppy.ring_the_bell | |
end | |
When /^it wags its tail$/ do | |
pending # express the regexp above with the code you wish you had | |
end | |
Then /^we must take it out$/ do | |
pending # express the regexp above with the code you wish you had | |
end | |
Then /^then it will not pee on the floor$/ do | |
pending # express the regexp above with the code you wish you had | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment