Class: Guard::Unity::Notifier::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/unity/notifier/cli.rb

Constant Summary collapse

SEPARATOR =
'-'*100

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CLI

Returns a new instance of CLI.



12
13
14
# File 'lib/guard/unity/notifier/cli.rb', line 12

def initialize(options={})
  @formatador = options[:formatador] || Formatador.new
end

Instance Attribute Details

#formatadorObject

Returns the value of attribute formatador.



8
9
10
# File 'lib/guard/unity/notifier/cli.rb', line 8

def formatador
  @formatador
end

Instance Method Details

#notify(results = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/guard/unity/notifier/cli.rb', line 16

def notify(results={})
  cases   = results[:test_cases] || []
  table   = []
  errors  = []

  cases.each do |test_case|
    table   << _row(test_case)
    errors  << _error(test_case) if test_case[:failed]
  end
  _display_results results
  _display_table table
  _display_errors errors
end