Sha256: 975a1109f638b3eb9874aefc54333e9d21e5ae4d4eac6a6840621e5dee1af3ec

Contents?: true

Size: 1.14 KB

Versions: 21

Compression:

Stored size: 1.14 KB

Contents

Feature: Before Hook

  Scenario: Examine names of elements
    Given a file named "features/foo.feature" with:
      """
      Feature: Feature name

        Scenario: Scenario name
          Given a step

        Scenario Outline: Scenario Outline name
          Given a <placeholder>

          Examples: Examples Table name
            | <placeholder> |
            | step          |
      """
    And a file named "features/support/hook.rb" with:
      """
      names = []
      Before do |scenario|
        unless scenario.respond_to?(:scenario_outline)
          names << scenario.feature.name.split("\n").first
          names << scenario.name.split("\n").first
        else
          names << scenario.scenario_outline.feature.name.split("\n").first
          names << scenario.scenario_outline.name.split("\n").first
        end
        if(names.size == 4)
          raise "NAMES:\n" + names.join("\n") + "\n"
        end
      end
      """
    When I run `cucumber`
    Then the output should contain:
      """
            NAMES:
            Feature name
            Scenario name
            Feature name
            Scenario Outline name
      """

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cucumber-1.3.20 features/before_hook.feature
cucumber-1.3.19 features/before_hook.feature
cucumber-1.3.18 features/before_hook.feature
cucumber-1.3.17 features/before_hook.feature
cucumber-1.3.16 features/before_hook.feature
cucumber-1.3.15 features/before_hook.feature
cucumber-1.3.14 features/before_hook.feature
cucumber-1.3.13 features/before_hook.feature
cucumber-1.3.12 features/before_hook.feature
cucumber-1.3.11 features/before_hook.feature
cucumber-1.3.10 features/before_hook.feature
cucumber-1.3.9 features/before_hook.feature
cucumber-1.3.8 features/before_hook.feature
cucumber-1.3.7 features/before_hook.feature
cucumber-1.3.6 features/before_hook.feature
cucumber-1.3.5 features/before_hook.feature
cucumber-1.3.4 features/before_hook.feature
cucumber-1.3.3 features/before_hook.feature
cucumber-1.3.2 features/before_hook.feature
cucumber-1.3.1 features/before_hook.feature