Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## cucumber.yml
- default: --format progress features
- ## directory structure and feature files
- features/first.feature
- features/by_role/second.feature
- ## content of features/first.feature
- Feature: first
- Scenario: first
- Given I am on "page 1"
- ## content of features/by_roles/second.feature
- Feature: second
- Scenario: second
- Given I am on "page 2"
- ## support/paths.rb
- def path_to(page_name)
- case page_name
- when /the homepage/
- '/'
- # Add more mappings here.
- # Here is a more fancy example:
- #
- # when /^(.*)'s profile page$/i
- # user_profile_path(User.find_by_login($1))
- when /page 1/
- "/"
- when /page 2/
- "/"
- else
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
- "Now, go and add a mapping in #{__FILE__}"
- end
- end
- ## this shell command works as expected
- $ cucumber
- ..
- 2 scenarios (2 passed)
- 2 steps (2 passed)
- 0m0.049s
- ## this shell command works as expected too
- $ cucumber features/first.feature
- Feature: first
- Scenario: first # features/first.feature:3
- Given I am on "page 1" # features/step_definitions/webrat_steps.rb:6
- 1 scenario (1 passed)
- 1 step (1 passed)
- 0m0.050s
- ## this shell command does NOT work as expected
- $ cucumber features/by_role/second.feature
- Feature: second
- Scenario: second # features/by_role/second.feature:3
- Given I am on "page 2" # features/by_role/second.feature:4
- 1 scenario (1 undefined)
- 1 step (1 undefined)
- 0m0.001s
- You can implement step definitions for undefined steps with these snippets:
- Given /^I am on "([^\"]*)"$/ do |arg1|
- pending
- end
Add Comment
Please, Sign In to add comment