Sha256: c03ac64b657092e9b00a0338211d1c9c742558fa38dcf6681a58e4e3fff672fe

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 KB

Contents

module Cucumber
  class StepMatch
    attr_reader :step_definition
    attr_reader :args
    
    def initialize(step_definition, step_name, formatted_step_name, args)
      @step_definition, @step_name, @formatted_step_name, @args = step_definition, step_name, formatted_step_name, args
    end
    
    def invoke(world, multiline_arg)
      all_args = @args.dup
      all_args << multiline_arg if multiline_arg
      @step_definition.invoke(world, all_args, @step_name)
    end

    def format_args(format)
      @formatted_step_name || @step_definition.format_args(@step_name, format)
    end
    
    def file_colon_line
      @step_definition.file_colon_line
    end

    def backtrace_line
      @step_definition.backtrace_line
    end
  end
  
  class NoStepMatch
    attr_reader :step_definition

    def initialize(step)
      @step = step
    end
    
    def format_args(format)
      @step.name
    end

    def file_colon_line
      raise "No file:line for #{@step}" unless @step.file_colon_line
      @step.file_colon_line
    end

    def backtrace_line
      @step.backtrace_line
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.100.1 lib/cucumber/step_match.rb
aslakhellesoy-cucumber-0.1.100.2 lib/cucumber/step_match.rb
aslakhellesoy-cucumber-0.1.100.3 lib/cucumber/step_match.rb
aslakhellesoy-cucumber-0.1.100.4 lib/cucumber/step_match.rb
aslakhellesoy-cucumber-0.1.100.5 lib/cucumber/step_match.rb
aslakhellesoy-cucumber-0.2.0.1 lib/cucumber/step_match.rb
aslakhellesoy-cucumber-0.2.0 lib/cucumber/step_match.rb
kosmas58-cucumber-0.1.100.5 lib/cucumber/step_match.rb
kosmas58-cucumber-0.2.0.1 lib/cucumber/step_match.rb
kosmas58-cucumber-0.2.0 lib/cucumber/step_match.rb
cucumber-0.2.0 lib/cucumber/step_match.rb