Skip to content

Commit

Permalink
Add a FinishedTesting event
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwynne committed Mar 20, 2016
1 parent a75423e commit 4eecb88
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/cucumber/events/finished_testing.rb
@@ -0,0 +1,9 @@
module Cucumber
module Events

# Event fired after aall test cases have finished executing
class FinishedTesting
end

end
end
1 change: 1 addition & 0 deletions lib/cucumber/formatter/event_bus_report.rb
Expand Up @@ -29,6 +29,7 @@ def after_test_case(test_case, result)
end

def done
@config.notify Events::FinishedTesting.new
end
end

Expand Down
9 changes: 9 additions & 0 deletions spec/cucumber/formatter/event_bus_report_spec.rb
Expand Up @@ -68,6 +68,15 @@ module Formatter
expect(received_event.test_case.name).to eq "Test Scenario"
expect(received_event.result).to be_passed
end

it "emits a Done event when the test run is finished" do
received_event = nil
config.on_event Cucumber::Events::FinishedTesting do |event|
received_event = event
end
run_defined_feature
expect(received_event).not_to be_nil
end
end
end
end
Expand Down

0 comments on commit 4eecb88

Please sign in to comment.