Class: Quarantini::Reporters::RspecReporter

Inherits:
RSpec::Core::Formatters::BaseFormatter
  • Object
show all
Defined in:
lib/quarantini/reporters/rspec_reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ RspecReporter

Returns a new instance of RspecReporter.



12
13
14
15
# File 'lib/quarantini/reporters/rspec_reporter.rb', line 12

def initialize(output)
  super
  @quarantine_results = []
end

Instance Method Details

#close(_notification) ⇒ Object



32
33
34
# File 'lib/quarantini/reporters/rspec_reporter.rb', line 32

def close(_notification)
  output.write @quarantine_results.to_json
end

#example_failed(failure) ⇒ Object



27
28
29
30
# File 'lib/quarantini/reporters/rspec_reporter.rb', line 27

def example_failed(failure)
  example = failure.example
  register_result(example, false) if example.[:quarantine]
end

#example_passed(passed) ⇒ Object



17
18
19
20
# File 'lib/quarantini/reporters/rspec_reporter.rb', line 17

def example_passed(passed)
  example = passed.example
  register_result(example, true) if example.[:quarantine]
end

#example_pending(skipped) ⇒ Object



22
23
24
25
# File 'lib/quarantini/reporters/rspec_reporter.rb', line 22

def example_pending(skipped)
  example = skipped.example
  register_result(example, nil) if example.[:quarantine]
end