Class: RoxClient::RSpec::Formatter
- Inherits:
-
Object
- Object
- RoxClient::RSpec::Formatter
- Defined in:
- lib/rox-client-rspec/formatter.rb
Instance Method Summary collapse
- #close(notification) ⇒ Object
- #example_failed(example_notification) ⇒ Object
- #example_group_finished(group_notification) ⇒ Object
- #example_group_started(group_notification) ⇒ Object
- #example_passed(example_notification) ⇒ Object
- #example_started(example_notification) ⇒ Object
-
#initialize(output) ⇒ Formatter
constructor
A new instance of Formatter.
- #start(notification) ⇒ Object
- #stop(notification) ⇒ Object
Constructor Details
Instance Method Details
#close(notification) ⇒ Object
52 53 54 |
# File 'lib/rox-client-rspec/formatter.rb', line 52 def close notification @client.process @test_run end |
#example_failed(example_notification) ⇒ Object
42 43 44 |
# File 'lib/rox-client-rspec/formatter.rb', line 42 def example_failed example_notification add_result example_notification, false end |
#example_group_finished(group_notification) ⇒ Object
30 31 32 |
# File 'lib/rox-client-rspec/formatter.rb', line 30 def example_group_finished group_notification @groups.pop end |
#example_group_started(group_notification) ⇒ Object
26 27 28 |
# File 'lib/rox-client-rspec/formatter.rb', line 26 def example_group_started group_notification @groups << group_notification.group end |
#example_passed(example_notification) ⇒ Object
38 39 40 |
# File 'lib/rox-client-rspec/formatter.rb', line 38 def example_passed example_notification add_result example_notification, true end |
#example_started(example_notification) ⇒ Object
34 35 36 |
# File 'lib/rox-client-rspec/formatter.rb', line 34 def example_started example_notification @current_time = Time.now end |
#start(notification) ⇒ Object
21 22 23 24 |
# File 'lib/rox-client-rspec/formatter.rb', line 21 def start notification # TODO: measure milliseconds @start_time = Time.now end |
#stop(notification) ⇒ Object
46 47 48 49 50 |
# File 'lib/rox-client-rspec/formatter.rb', line 46 def stop notification end_time = Time.now @test_run.end_time = end_time.to_i * 1000 @test_run.duration = ((end_time - @start_time) * 1000).round end |