Class: Spec::Runner::Formatter::SpecdocFormatter

Inherits:
BaseTextFormatter show all
Defined in:
lib/spec/runner/formatter/specdoc_formatter.rb

Instance Attribute Summary

Attributes inherited from BaseTextFormatter

#dry_run

Instance Method Summary collapse

Methods inherited from BaseTextFormatter

#close, #colour=, #colourise, #dump_failure, #dump_pending, #dump_summary, #format_backtrace, #initialize

Methods inherited from BaseFormatter

#close, #dump_failure, #dump_pending, #dump_summary, #example_started, #initialize, #start, #start_dump

Constructor Details

This class inherits a constructor from Spec::Runner::Formatter::BaseTextFormatter

Instance Method Details

#add_behaviour(name) ⇒ Object



5
6
7
8
9
# File 'lib/spec/runner/formatter/specdoc_formatter.rb', line 5

def add_behaviour(name)
  @output.puts
  @output.puts name
  @output.flush
end

#example_failed(example, counter, failure) ⇒ Object



11
12
13
14
# File 'lib/spec/runner/formatter/specdoc_formatter.rb', line 11

def example_failed(example, counter, failure)
  @output.puts failure.expectation_not_met? ? red("- #{example.description} (FAILED - #{counter})") : magenta("- #{example.description} (ERROR - #{counter})")
  @output.flush
end

#example_passed(example) ⇒ Object



16
17
18
19
# File 'lib/spec/runner/formatter/specdoc_formatter.rb', line 16

def example_passed(example)
  @output.puts green("- #{example.description}")
  @output.flush
end

#example_pending(behaviour_name, example_name, message) ⇒ Object



21
22
23
24
25
# File 'lib/spec/runner/formatter/specdoc_formatter.rb', line 21

def example_pending(behaviour_name, example_name, message)
  super
  @output.puts yellow("- #{example_name} (PENDING: #{message})")
  @output.flush
end