Class: Respec::Formatter

Inherits:
RSpec::Core::Formatters::BaseFormatter
  • Object
show all
Defined in:
lib/respec/formatter.rb,
lib/respec/formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output = nil) ⇒ Formatter

Returns a new instance of Formatter.



12
13
14
# File 'lib/respec/formatter.rb', line 12

def initialize(output=nil)
  super(output)
end

Instance Method Details

#example_failed(notification) ⇒ Object



33
34
35
# File 'lib/respec/formatter.rb', line 33

def example_failed(notification)
  @respec_failures << notification.example.full_description
end

#start_dump(notification) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/respec/formatter.rb', line 16

def start_dump
  open(Respec.failures_path, 'w') do |file|
    @failed_examples.each do |example|
      file.puts example.[:full_description]
    end
  end
end