Sha256: 8bb39fbd11ed921fb39347b1c60ecb72531092b219b1c0b01a0c324c41b6be86

Contents?: true

Size: 1.56 KB

Versions: 14

Compression:

Stored size: 1.56 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 (.*)$/ do |line|
      end
      """
    And a file named "features/support/jb/formatter.rb" with:
      """
      module Jb
        class Formatter
          def initialize(step_mother, io, options)
            @step_mother = step_mother
            @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

14 entries across 12 versions & 5 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
cucumber-1.2.5 features/formatter_step_file_colon_line.feature
cucumber-1.2.3 features/formatter_step_file_colon_line.feature
cucumber-1.2.2 features/formatter_step_file_colon_line.feature
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
casecumber-1.2.1.cb2 features/formatter_step_file_colon_line.feature
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/features/formatter_step_file_colon_line.feature
cucumber-1.2.1 features/formatter_step_file_colon_line.feature
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/features/formatter_step_file_colon_line.feature
cucumber-1.2.0 features/formatter_step_file_colon_line.feature