Sha256: c43ddaa3700fc88bba03671a2d16adecd96009fd5d4a18cb993eb9467fd3cd84

Contents?: true

Size: 1.76 KB

Versions: 3

Compression:

Stored size: 1.76 KB

Contents

Feature: Snippets

  Cucumber helpfully prints out any undefined step definitions as a code
  snippet suggestion, which you can then paste into a step definitions
  file of your choosing.

  Scenario: Snippet for undefined step with a Doc String
    Given a file named "features/undefined_steps.feature" with:
      """
      Feature:
        Scenario: Doc String
          Given a Doc String
          \"\"\"
            example with <html> entities
          \"\"\"
          When 1 simple when step
          And another "when" step
          Then a simple then step
      """
    When I run `cucumber features/undefined_steps.feature -s`
    Then the output should contain:
      """
      Given("a Doc String") do |string|
        pending # Write code here that turns the phrase above into concrete actions
      end

      When("{int} simple when step") do |int|
        pending # Write code here that turns the phrase above into concrete actions
      end

      When("another {string} step") do |string|
        pending # Write code here that turns the phrase above into concrete actions
      end

      Then("a simple then step") do
        pending # Write code here that turns the phrase above into concrete actions
      end
      """

  Scenario: Snippet for undefined step with a step table
    Given a file named "features/undefined_steps.feature" with:
      """
      Feature:
        Scenario: table
          Given a table
            | table |
            |example|
      """
    When I run `cucumber features/undefined_steps.feature -s`
    Then the output should contain:
      """
      Given("a table") do |table|
        # table is a Cucumber::MultilineArgument::DataTable
        pending # Write code here that turns the phrase above into concrete actions
      end
      """

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-3.0.1 features/docs/defining_steps/snippets.feature
cucumber-3.0.0 features/docs/defining_steps/snippets.feature
cucumber-3.0.0.pre.2 features/docs/defining_steps/snippets.feature