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
11 changes: 10 additions & 1 deletion features/animal.feature
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
#Create your feature here
Feature: Animal
As a cat, I should have a name, type, and age
As a cat under 3 years old
I am not old

Scenario: Cat
Given an animal
Then it has a name 'Elsa'
And it has an age of 2
And it is not 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$/) do
@animal = Animal.new('Elsa', 'cat', 2)
end

Then(/^it has a name 'Elsa'$/) do
expect(@animal.name).to eq('Elsa')
end

Then(/^it has an age of (\d+)$/) do |arg1|
expect(@animal.age).to eq(2)
end

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