Skip to content

Commit

Permalink
Simplify Runtime API by using EventBus for StepMatches
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwynne committed Sep 4, 2015
1 parent 752fe0d commit 8bb7860
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/cucumber/formatter/usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ def initialize(runtime, path_or_io, options)
@options = options
@stepdef_to_match = Hash.new { |h, stepdef_key| h[stepdef_key] = [] }
@total_duration = 0
@matches = {}
runtime.configuration.on_event :step_match do |event|
@matches[event.test_step.source] = event.step_match
end
end

def after_test_step(test_step, result)
return if HookQueryVisitor.new(test_step).hook?

step_match = @runtime.step_match(test_step.source.last.name)
step_match = @matches[test_step.source]
step_definition = step_match.step_definition
stepdef_key = StepDefKey.new(step_definition.regexp_source, step_definition.location)
unless @stepdef_to_match[stepdef_key].map { |key| key[:location] }.include? test_step.location
Expand Down
4 changes: 0 additions & 4 deletions lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ def steps(status = nil)
@results.steps(status)
end

def step_match(step_name, name_to_report=nil) #:nodoc:
@support_code.step_match(step_name, name_to_report)
end

def unmatched_step_definitions
@support_code.unmatched_step_definitions
end
Expand Down

0 comments on commit 8bb7860

Please sign in to comment.