Class: Easytest::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/easytest/reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Reporter

Returns a new instance of Reporter.



5
6
7
# File 'lib/easytest/reporter.rb', line 5

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/easytest/reporter.rb', line 3

def name
  @name
end

Instance Method Details

#report_error(error) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/easytest/reporter.rb', line 9

def report_error(error)
  case error
  when MatchError
    report_match_error(error)
  when FatalError
    report_fatal_error(error)
  end
end

#report_skipObject



18
19
20
# File 'lib/easytest/reporter.rb', line 18

def report_skip
  Rainbow("⚠ skipped \"#{name}\"").yellow
end

#report_todoObject



22
23
24
# File 'lib/easytest/reporter.rb', line 22

def report_todo
  Rainbow("✎ todo \"#{name}\"").magenta
end