You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- Feature: State
-
- You can pass state between step by setting instance variables,
- but those instance variables will be gone when the next scenario runs.
-
- Scenario: Set an ivar in one scenario, use it in the next step
- Given a file named "features/test.feature" with:
- """
- Feature:
- Scenario:
- Given I have set @flag = true
- Then @flag should be true
-
- Scenario:
- Then @flag should be nil
- """
- And a file named "features/step_definitions/steps.rb" with:
- """
- Given /set @flag/ do
- @flag = true
- end
- Then /flag should be true/ do
- expect(@flag).to be_truthy
- end
- Then /flag should be nil/ do
- expect(@flag).to be_nil
- end
- """
- When I run `cucumber`
- Then it should pass
-
|