Sha256: afe4c29e7967ac4ee8d926c499ddc126037f17ff5e7f76d830a66125dd3200d4

Contents?: true

Size: 808 Bytes

Versions: 28

Compression:

Stored size: 808 Bytes

Contents

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


Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
cucumber-3.0.1 features/docs/writing_support_code/state.feature
cucumber-2.99.0 features/docs/writing_support_code/state.feature
cucumber-3.0.0 features/docs/writing_support_code/state.feature
cucumber-3.0.0.pre.2 features/docs/writing_support_code/state.feature
mobiusloop-0.1.5 features/docs/writing_support_code/state.feature
cucumber-3.0.0.pre.1 features/docs/writing_support_code/state.feature
cucumber-2.4.0 features/docs/writing_support_code/state.feature
mobiusloop-0.1.3 features/docs/writing_support_code/state.feature
mobiusloop-0.1.2 features/docs/writing_support_code/state.feature
cucumber-2.3.3 features/docs/writing_support_code/state.feature
cucumber-2.3.2 features/docs/writing_support_code/state.feature
cucumber-2.3.1 features/docs/writing_support_code/state.feature
cucumber-2.3.0 features/docs/writing_support_code/state.feature
cucumber-2.2.0 features/docs/writing_support_code/state.feature
cucumber-2.1.0 features/docs/writing_support_code/state.feature
cucumber-2.0.2 features/docs/writing_support_code/state.feature
cucumber-2.0.1 features/docs/writing_support_code/state.feature
cucumber-2.0.0 features/docs/writing_support_code/state.feature
cucumber-2.0.0.rc.5 features/docs/writing_support_code/state.feature
cucumber-2.0.0.rc.4 features/docs/writing_support_code/state.feature