class Rspec::Rotten::Formatters::InitialReportFormatter
Public Class Methods
new(output)
click to toggle source
# File lib/rspec/rotten/formatters/initial_report_formatter.rb, line 8 def initialize(output) @output = output @arr = [] end
Public Instance Methods
close(notification)
click to toggle source
# File lib/rspec/rotten/formatters/initial_report_formatter.rb, line 25 def close(notification) @output.write @arr.to_json @output.close if IO === @output && @output != $stdout end
example_failed(notification)
click to toggle source
# File lib/rspec/rotten/formatters/initial_report_formatter.rb, line 17 def example_failed(notification) @arr << example_data(notification.example, :failed) end
example_passed(notification)
click to toggle source
# File lib/rspec/rotten/formatters/initial_report_formatter.rb, line 13 def example_passed(notification) @arr << example_data(notification.example, :passed) end
example_pending(notification)
click to toggle source
# File lib/rspec/rotten/formatters/initial_report_formatter.rb, line 21 def example_pending(notification) @arr << example_data(notification.example, :pending) end
Private Instance Methods
example_data(example, status)
click to toggle source
# File lib/rspec/rotten/formatters/initial_report_formatter.rb, line 32 def example_data(example, status) { id: example.id, state: status, date: Time.now, location: example.location, description: example.description } end