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

Onboarding chris #32

Open
wants to merge 2 commits 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
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

Scenario: Animal is a cat
Given an animal
When the animal is a Cat
And the anmial is named "Bob"
And the animal is 2 years old
Then the type should be "Cat"
And the name should be "Bob"
And the age should be 2
Binary file not shown.
33 changes: 32 additions & 1 deletion features/step_definitions/animal_steps.rb
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
#Delete this comment, here is where you should write your step defs
Transform (/^(-?\d+)$/) do |number|
number.to_i
end

Given(/^an animal$/) do
@animal = Animal.new('Bob', 'Cat', 2)
end

When(/^the animal is a (.*?)$/) do |type|
expect(@animal.type).to eq type
end

When(/^the anmial is named "(.*?)"$/) do |arg1|
expect(@animal.name).to eq arg1
end

When (/^the animal is (\d+) years old$/) do |age|
expect(@animal.age).to eq age
end

Then (/^the type should be "(.*?)"$/) do |type|
expect(@animal.type).to eq type
end

Then(/^the name should be "(.*?)"$/) do |name|
expect(@animal.name).to eq name
end

Then(/^the age should be (\d+)$/) do |age|
expect(@animal.age).to eq age
end