Class: Aspec::Formatter::Terminal
- Inherits:
-
Object
- Object
- Aspec::Formatter::Terminal
- Includes:
- Term::ANSIColor
- Defined in:
- lib/aspec/formatters/terminal.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #comment(comment_string) ⇒ Object
- #debug(step) ⇒ Object
- #dump_summary(summary) ⇒ Object
- #exception(error_string) ⇒ Object
-
#initialize(verbose, out = STDOUT) ⇒ Terminal
constructor
A new instance of Terminal.
- #step_error(step) ⇒ Object
- #step_error_title(step) ⇒ Object
- #step_pass(step) ⇒ Object
Constructor Details
#initialize(verbose, out = STDOUT) ⇒ Terminal
Returns a new instance of Terminal.
7 8 9 10 11 |
# File 'lib/aspec/formatters/terminal.rb', line 7 def initialize(verbose, out = STDOUT) @out = out @verbose = verbose @line_buffer ||= [] end |
Instance Method Details
#clear ⇒ Object
13 14 15 |
# File 'lib/aspec/formatters/terminal.rb', line 13 def clear @line_buffer.clear end |
#comment(comment_string) ⇒ Object
17 18 19 |
# File 'lib/aspec/formatters/terminal.rb', line 17 def comment(comment_string) line(comment_string) end |
#debug(step) ⇒ Object
38 39 40 |
# File 'lib/aspec/formatters/terminal.rb', line 38 def debug(step) @out.puts(step.inspect) end |
#dump_summary(summary) ⇒ Object
42 43 44 |
# File 'lib/aspec/formatters/terminal.rb', line 42 def dump_summary(summary) @out.puts summary end |
#exception(error_string) ⇒ Object
21 22 23 |
# File 'lib/aspec/formatters/terminal.rb', line 21 def exception(error_string) line(error_string) end |
#step_error(step) ⇒ Object
29 30 31 32 |
# File 'lib/aspec/formatters/terminal.rb', line 29 def step_error(step) line(red + step_line(step) + reset) print_error unless @verbose end |
#step_error_title(step) ⇒ Object
25 26 27 |
# File 'lib/aspec/formatters/terminal.rb', line 25 def step_error_title(step) step_line(step) end |
#step_pass(step) ⇒ Object
34 35 36 |
# File 'lib/aspec/formatters/terminal.rb', line 34 def step_pass(step) line(green + step_line(step) + reset) end |