Created
March 12, 2016 10:38
-
-
Save gongo/97eda04fbb4cd01cbd73 to your computer and use it in GitHub Desktop.
[Turnip Example] hook to after scenario step https://groups.google.com/forum/#!topic/ruby-turnip/WRD0WXqQsYc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle install --path vendor/bundle | |
$ bundle exec rspec | |
"background when" | |
"background then" | |
"scenario1 when" | |
"scenario1 then" | |
"after step" | |
."background when" | |
"background then" | |
"scenario2 when" | |
"scenario2 then" | |
"after step" | |
. | |
Finished in 0.00341 seconds (files took 0.14205 seconds to load) | |
2 examples, 0 failures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|-- Gemfile | |
|-- Gemfile.lock | |
`-- spec | |
|-- features | |
| `-- example.feature | |
|-- spec_helper.rb | |
`-- steps | |
`-- example_steps.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Example | |
Background: | |
When text is "background when" | |
When text is "background then" | |
Scenario: scenario1 | |
When text is "scenario1 when" | |
Then text is "scenario1 then" | |
Scenario: scenario1 | |
When text is "scenario2 when" | |
Then text is "scenario2 then" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step 'text is :text' do |text| | |
p text | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "turnip" | |
gem 'rspec' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir.glob("spec/steps/**/*steps.rb") { |f| load f, true } | |
RSpec.configure do |config| | |
config.after type: :feature do | |
p 'after step' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment