Sha256: 005d25b22e8601fbc1ec3d25aba1d1cc6573e459d4d73f8f3d6fb4b36efac88c

Contents?: true

Size: 1.48 KB

Versions: 30

Compression:

Stored size: 1.48 KB

Contents

Feature: Tagged hooks

  Background:
    Given a standard Cucumber project directory structure
    And a file named "features/step_definitions/steps.rb" with:
      """
      Given /^this step works$/ do; end
      """
    And a file named "features/support/hooks.rb" with:
      """
      Before('~@no-boom') do 
        raise 'boom'
      end
      """
    And a file named "features/f.feature" with:
      """
      Feature: With and without hooks
        Scenario: using hook
          Given this step works

        @no-boom
        Scenario: omitting hook
          Given this step works
      """

  Scenario: omit tagged hook
    When I run cucumber features/f.feature:2
    Then it should fail with
      """
      Feature: With and without hooks
      
        Scenario: using hook    # features/f.feature:2
        boom (RuntimeError)
        ./features/support/hooks.rb:2:in `Before'
          Given this step works # features/step_definitions/steps.rb:1
      
      Failing Scenarios:
      cucumber features/f.feature:2 # Scenario: using hook
      
      1 scenario (1 failed)
      1 step (1 skipped)

      """

    Scenario: omit tagged hook
      When I run cucumber features/f.feature:6
      Then it should pass with
        """
        Feature: With and without hooks

          @no-boom
          Scenario: omitting hook # features/f.feature:6
            Given this step works # features/step_definitions/steps.rb:1

        1 scenario (1 passed)
        1 step (1 passed)

        """


Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
cucumber-0.8.7 features/negative_tagged_hooks.feature
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/cucumber-0.9.4/features/negative_tagged_hooks.feature
vim-jar-0.1.2 bundler/ruby/1.8/gems/cucumber-0.9.4/features/negative_tagged_hooks.feature
vim-jar-0.1.1 bundler/ruby/1.8/gems/cucumber-0.9.4/features/negative_tagged_hooks.feature
vim-jar-0.1.0 bundler/ruby/1.8/gems/cucumber-0.9.4/features/negative_tagged_hooks.feature
cucumber-0.9.4 features/negative_tagged_hooks.feature
cucumber-0.9.3 features/negative_tagged_hooks.feature
cucumber-0.9.2 features/negative_tagged_hooks.feature
cucumber-0.9.1 features/negative_tagged_hooks.feature
cucumber-0.9.0 features/negative_tagged_hooks.feature
cucumber-0.8.5 features/negative_tagged_hooks.feature
cucumber-0.8.4 features/negative_tagged_hooks.feature
cucumber-0.8.3 features/negative_tagged_hooks.feature
cucumber-0.8.2 features/negative_tagged_hooks.feature
cucumber-0.8.1 features/negative_tagged_hooks.feature
cucumber-0.8.0 features/negative_tagged_hooks.feature
cucumber-0.7.3 features/negative_tagged_hooks.feature
cucumber-0.7.2 features/negative_tagged_hooks.feature
cucumber-0.7.1 features/negative_tagged_hooks.feature
cucumber-0.7.0 features/negative_tagged_hooks.feature