Sha256: 476a90fbd4edc929dd1a3302c885f3ccd239cd6f7c2a7ff1012d5a8f3cf20a5f

Contents?: true

Size: 1.51 KB

Versions: 26

Compression:

Stored size: 1.51 KB

Contents

Feature: Formatter API: Step file path and line number (Issue #179)
  To all reporter to understand location of current executing step let's fetch this information
  from step/step_invocation and pass to reporters

  Scenario: my own formatter
    Given a file named "features/f.feature" with:
      """
      Feature: I'll use my own
        because I'm worth it
        Scenario: just print step current line and feature file name
          Given step at line 4
          Given step at line 5
      """
    And a file named "features/step_definitions/steps.rb" with:
      """
      Given(/^step at line (.*)$/) {|line| }
      """
    And a file named "features/support/jb/formatter.rb" with:
      """
      module Jb
        class Formatter
          def initialize(runtime, io, options)
            @io = io
          end

          def before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line)
            @io.puts "step result event: #{file_colon_line}"
          end

          def step_name(keyword, step_match, status, source_indent, background, file_colon_line)
            @io.puts "step name event: #{file_colon_line}"
          end
        end
      end
      """
    When I run `cucumber features/f.feature --format Jb::Formatter`
    Then it should pass with exactly:
      """
      step result event: features/f.feature:4
      step name event: features/f.feature:4
      step result event: features/f.feature:5
      step name event: features/f.feature:5

      """

Version data entries

26 entries across 26 versions & 2 rubygems

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