Skip to content
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
10 changes: 10 additions & 0 deletions features/animal.feature
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
#Create your feature here

Feature: Animal
As a cat, I should have name, type, and age
and I'm considered old if I'm over 3 years.

Scenario: Cat
Given an animal that is four years old
Then it is named 'Gidget'
And it has a type of 'cat'
And it is considered old
16 changes: 15 additions & 1 deletion features/step_definitions/animal_steps.rb
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
#Delete this comment, here is where you should write your step defs
Given(/^an animal that is four years old$/) do
@animal = Animal.new('Gidget', 'cat', 4)
end

Then(/^it is named 'Gidget'$/) do
expect(@animal.name).to eq 'Gidget'
end

Then(/^it has a type of 'cat'$/) do
expect(@animal.type).to eq 'cat'
end

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