Sha256: 6352a514a2ee70ad0c01b9ec5ea6a392a060e20009fbead40650d24e6d3b801d

Contents?: true

Size: 1.32 KB

Versions: 76

Compression:

Stored size: 1.32 KB

Contents

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 standard Cucumber project directory structure
  
  Scenario: Two Ruby step definitions, in the same file
    Given a file named "features/step_definitions/foo_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
    And the output should contain the following JSON:
      """
      [
        {"source": "foo", "flags": "i"},
        {"source": "b.r", "flags": "mx"}
      ]
      """

  Scenario: Non-default directory structure
    Given a file named "my_weird/place/foo_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
    And the output should contain the following JSON:
      """
      [
        {"source": "foo", "flags": ""},
        {"source": "b.r", "flags": "x"}
      ]
      
      """

Version data entries

76 entries across 74 versions & 11 rubygems

Version Path
cucumber-1.3.20 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.19 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.18 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.17 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.16 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.15 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.14 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.13 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.12 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.11 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.10 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.9 legacy_features/api/list_step_defs_as_json.feature
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/legacy_features/api/list_step_defs_as_json.feature
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/legacy_features/api/list_step_defs_as_json.feature
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.8 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.7 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.6 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.5 legacy_features/api/list_step_defs_as_json.feature
cucumber-1.3.4 legacy_features/api/list_step_defs_as_json.feature