Class: Easytest::Reporter
- Inherits:
-
Object
- Object
- Easytest::Reporter
- Defined in:
- lib/easytest/reporter.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Reporter
constructor
A new instance of Reporter.
- #report_error(error) ⇒ Object
- #report_skip ⇒ Object
- #report_todo ⇒ Object
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
#name ⇒ Object (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_skip ⇒ Object
18 19 20 |
# File 'lib/easytest/reporter.rb', line 18 def report_skip Rainbow("⚠ skipped \"#{name}\"").yellow end |
#report_todo ⇒ Object
22 23 24 |
# File 'lib/easytest/reporter.rb', line 22 def report_todo Rainbow("✎ todo \"#{name}\"").magenta end |