Skip to content

Instantly share code, notes, and snippets.

@artm
Created March 20, 2012 15:28
Show Gist options
  • Save artm/2137032 to your computer and use it in GitHub Desktop.
Save artm/2137032 to your computer and use it in GitHub Desktop.
fail in bg the second time around
Given /^I puts "([^"]*)"$/ do |arg1|
if !$ran
puts arg1
$ran = arg1 == 'fg1'
else
true.should == false
end
end
@bg
Feature: backound
As artm
In order to know better
I want to test background
Background: # features/test.feature:7
Given I puts "bg" # features/step_definitions/bg.rb:3
bg
Scenario: one # features/test.feature:10
Then I puts "fg1" # features/step_definitions/bg.rb:3
fg1
Scenario: two # features/test.feature:13
Given I puts "bg" # features/step_definitions/bg.rb:3
expected: false
got: true (using ==) (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/bg.rb:8:in `/^I puts "([^"]*)"$/'
features/test.feature:8:in `Given I puts "bg"'
Then I puts "fg2" # features/step_definitions/bg.rb:3
Failing Scenarios:
cucumber features/test.feature:13 # Scenario: two
2 scenarios (1 failed, 1 passed)
4 steps (1 failed, 1 skipped, 2 passed)
0m0.005s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment