Sha256: ff2ef660e290ddf4bc38d63cf67c886096aec618b199e4f01e3fad52a7133bac

Contents?: true

Size: 1.21 KB

Versions: 25

Compression:

Stored size: 1.21 KB

Contents

@spawn
Feature: List step defs as json

  In order to build tools on top of Cucumber
  As a tool developer
  I want to be able to query a features directory for all the step definitions it contains

  Background:
    Given a directory named "features"

  Scenario: Two Ruby step definitions, in the same file
    Given a file named "features/step_definitions/steps.rb" with:
      """
      Given(/foo/i)  { }
      Given(/b.r/xm) { }
      """
    When I run the following Ruby code:
      """
      require 'cucumber'
      puts Cucumber::StepDefinitions.new.to_json
      
      """
    Then it should pass with JSON:
      """
      [
        {"source": "foo", "flags": "i"},
        {"source": "b.r", "flags": "mx"}
      ]
      """

  Scenario: Non-default directory structure
    Given a file named "my_weird/place/steps.rb" with:
      """
      Given(/foo/)  { }
      Given(/b.r/x) { }
      """
    When I run the following Ruby code:
      """
      require 'cucumber'
      puts Cucumber::StepDefinitions.new(:autoload_code_paths => ['my_weird']).to_json
      
      """
    Then it should pass with JSON:
      """
      [
        {"source": "foo", "flags": ""},
        {"source": "b.r", "flags": "x"}
      ]
      
      """

Version data entries

25 entries across 25 versions & 2 rubygems

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