Class: Cadre::RSpec3::TrueFeelingsFormatter

Inherits:
RSpec::Core::Formatters::BaseFormatter
  • Object
show all
Includes:
RSpec::Core::Formatters::ConsoleCodes
Defined in:
lib/cadre/rspec3/true-feelings-formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ TrueFeelingsFormatter

Returns a new instance of TrueFeelingsFormatter.



7
8
9
10
# File 'lib/cadre/rspec3/true-feelings-formatter.rb', line 7

def initialize(output)
  super
  @any_fails_yet = false
end

Instance Method Details

#example_failed(notification) ⇒ Object



12
13
14
# File 'lib/cadre/rspec3/true-feelings-formatter.rb', line 12

def example_failed(notification)
  @any_fails_yet = true
end

#example_passed(example) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/cadre/rspec3/true-feelings-formatter.rb', line 16

def example_passed(example)
  unless @any_fails_yet
    super
  else
    output.print wrap("u", :failure)
  end
end