Class: Tst::Reporters::Pretty

Inherits:
Plain
  • Object
show all
Defined in:
lib/tst/reporters/pretty.rb

Constant Summary

Constants inherited from Plain

Tst::Reporters::Plain::BACKTRACE_FILTER

Instance Attribute Summary

Attributes inherited from Plain

#io, #results

Instance Method Summary collapse

Methods inherited from Plain

#conclusion, #exception_details, #exceptions, #failure_details, #failures, #filter_backtrace, #initialize, #summarize

Constructor Details

This class inherits a constructor from Tst::Reporters::Plain

Instance Method Details

#backtraceObject



21
# File 'lib/tst/reporters/pretty.rb', line 21

def backtrace(*)        cyan(super)   end

#black(s) ⇒ Object



6
# File 'lib/tst/reporters/pretty.rb', line 6

def black(s)   color(30, s) end

#blue(s) ⇒ Object



10
# File 'lib/tst/reporters/pretty.rb', line 10

def blue(s)    color(34, s) end

#color(n, s) ⇒ Object



4
# File 'lib/tst/reporters/pretty.rb', line 4

def color(n, s) "\e[#{n}m#{s}\e[0m" end

#cyan(s) ⇒ Object



12
# File 'lib/tst/reporters/pretty.rb', line 12

def cyan(s)    color(36, s) end

#exception(result) ⇒ Object



17
# File 'lib/tst/reporters/pretty.rb', line 17

def exception(result) io.print yellow('E') end

#exception_headerObject



22
# File 'lib/tst/reporters/pretty.rb', line 22

def exception_header(*) yellow(super) end

#expected_actualObject



20
# File 'lib/tst/reporters/pretty.rb', line 20

def expected_actual(*)  white(super)  end

#failedObject



25
# File 'lib/tst/reporters/pretty.rb', line 25

def failed; red(super)    end

#failure(result) ⇒ Object



16
# File 'lib/tst/reporters/pretty.rb', line 16

def failure(result)   io.print red('F')    end

#failure_headerObject



19
# File 'lib/tst/reporters/pretty.rb', line 19

def failure_header(*)   red(super)    end

#green(s) ⇒ Object



8
# File 'lib/tst/reporters/pretty.rb', line 8

def green(s)   color(32, s) end

#magenta(s) ⇒ Object



11
# File 'lib/tst/reporters/pretty.rb', line 11

def magenta(s) color(35, s) end

#passedObject



24
# File 'lib/tst/reporters/pretty.rb', line 24

def passed; green(super)  end

#raisedObject



26
# File 'lib/tst/reporters/pretty.rb', line 26

def raised; yellow(super) end

#red(s) ⇒ Object



7
# File 'lib/tst/reporters/pretty.rb', line 7

def red(s)     color(31, s) end

#success(result) ⇒ Object



15
# File 'lib/tst/reporters/pretty.rb', line 15

def success(result)   io.print green('.')  end

#white(s) ⇒ Object



13
# File 'lib/tst/reporters/pretty.rb', line 13

def white(s)   color(37, s) end

#yellow(s) ⇒ Object



9
# File 'lib/tst/reporters/pretty.rb', line 9

def yellow(s)  color(33, s) end