Sha256: 20efc7a61695d0d2a1f833728dbb077cb0f4e78d9b8695e6a25a6a33645187ac

Contents?: true

Size: 1.92 KB

Versions: 1

Compression:

Stored size: 1.92 KB

Contents

@issue
Feature: Issue #188: Better diagnostics if nested step is undefined
  
  . Currently if nested step has no match, it's shown like this:
  .
  .     Assertion Failed: Sub-step failed: When I do strange thign
  .     Substep info: None
  .
  . Took some time to find that typo.
  . The suggestion is to fill substep error_message with at least "No match for step"
  . so it would become:
  .
  .     Assertion Failed: Sub-step failed: When I do strange thign
  .     Substep info: No match for step
  .
  . IMPLEMENTATION NOTE:
  . A slightly different output is provided:
  .
  .     Assertion Failed: UNDEFINED SUB-STEP: When I do strange thign


  Scenario: Nested steps contain an undefined step
    Given a new working directory
    And a file named "features/steps/steps.py" with:
      """
      from behave import step

      @step('{word:w} step passes')
      def step_passes(context, word):
          pass

      @then('a good diagnostic message is shown')
      def step_good_diagnostic_message_is_shown(context):
          pass

      @step('I execute nested steps with an undefined step')
      def step_passes(context):
          context.execute_steps(u'''
            Given another step passes
            When an undefined, nested step is executed
            Then third step passes
          ''')
      """
    And a file named "features/example.execute_nested_undefined_step.feature" with:
      """
      Feature:
        Scenario:
          Given a step passes
          When I execute nested steps with an undefined step
          Then a good diagnostic message is shown
      """
    When I run "behave -f plain -T features/example.execute_nested_undefined_step.feature"
    Then it should fail with:
      """
      Scenario:
        Given a step passes ... passed
        When I execute nested steps with an undefined step ... failed
      Assertion Failed: UNDEFINED SUB-STEP: When an undefined, nested step is executed
      """

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
busser-behave-0.1.3 vendor/behave/issue.features/issue0188.feature