Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a simple solution #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion features/animal.feature
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
#Create your feature here
Feature: Animal
In order to be greeted appropriately
I want to track an animal's name
I want to track an animal's age
I want to track an animal's type
I want to know if an animal is old

Scenario: age
Given a animal
Then it has a "age"

Scenario: type
Given a animal
Then it has a "type"

Scenario: name
Given a animal
Then it has a "name"

Scenario: old
Given a animal
When age is more than 3
Then it should say it is old
12 changes: 11 additions & 1 deletion features/step_definitions/animal_steps.rb
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
#Delete this comment, here is where you should write your step defs
Then(/^it has a "(.*?)"$/) do |attribute|
expect(@animal).to respond_to(attribute.to_sym)
end

When(/^age is more than (\d+)$/) do |age_limit|
expect(@animal.age).to be >= age_limit.to_i
end

Then(/^it should say it is old/) do
expect(@animal.old?).to be true
end