Class: XSpec::Notifier::Character

Inherits:
Object
  • Object
show all
Includes:
Composable, EmptyFormatter
Defined in:
lib/xspec/notifiers.rb

Overview

Outputs a single character for each executed unit of work representing the result.

Instance Method Summary collapse

Methods included from Composable

#+

Methods included from EmptyFormatter

#evaluate_start, #run_start

Constructor Details

#initialize(out = $stdout) ⇒ Character

Returns a new instance of Character.



61
62
63
# File 'lib/xspec/notifiers.rb', line 61

def initialize(out = $stdout)
  @out = out
end

Instance Method Details

#evaluate_finish(result) ⇒ Object



65
66
67
68
# File 'lib/xspec/notifiers.rb', line 65

def evaluate_finish(result)
  @out.print label_for_failure(result.errors[0])
  @failed ||= result.errors.any?
end

#run_finishObject



70
71
72
73
# File 'lib/xspec/notifiers.rb', line 70

def run_finish
  @out.puts
  !@failed
end