Skip to content

Instantly share code, notes, and snippets.

@diabolo
Created March 31, 2009 09:12
Show Gist options
  • Save diabolo/88118 to your computer and use it in GitHub Desktop.
Save diabolo/88118 to your computer and use it in GitHub Desktop.
Feature: Background
In for background to work properly
As a user
I want it to run transactionally and only once when I call an individual scenario
Background:
Given plop
Scenario: Barping
When I barp
Scenario: Wibbling
When I wibble
Given /^plop$/ do
puts 'plop'
end
When /^I barp$/ do
puts 'barp'
end
When /^I wibble$/ do
puts 'wibble'
end
# Result of running
# cucumber back.feature:13
Feature: Background
In for background to work properly
As a user
I want it to run transactionally and only once when I call an individual scenario
Background: # back.feature:6
plop
Given plop # back.steps.rb:1
Scenario: Wibbling # back.feature:13
plop
wibble
When I wibble # back.steps.rb:9
1 scenario
3 passed steps
# Result of running
# cucumber back.feature
Feature: Background
In for background to work properly
As a user
I want it to run transactionally and only once when I call an individual scenario
Background: # back.feature:6
plop
Given plop # back.steps.rb:1
Scenario: Barping # back.feature:9
barp
When I barp # back.steps.rb:5
Scenario: Wibbling # back.feature:13
plop
wibble
When I wibble # back.steps.rb:9
2 scenarios
4 passed steps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment