Class: Manacle::Formatter

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

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Formatter

Returns a new instance of Formatter.



88
89
90
# File 'lib/manacle/formatter.rb', line 88

def initialize(output)
  @output = output
end

Instance Method Details

#example_failed(notification) ⇒ Object



112
113
114
# File 'lib/manacle/formatter.rb', line 112

def example_failed(notification)
  @failed_count += 1
end

#example_finished(notification) ⇒ Object



120
121
122
# File 'lib/manacle/formatter.rb', line 120

def example_finished(notification)
  @examples.add(notification.example, ApiBanking::SoapClient.last_response)
end

#example_passed(notification) ⇒ Object



108
109
110
# File 'lib/manacle/formatter.rb', line 108

def example_passed(notification)
  @passed_count += 1
end

#example_pending(notification) ⇒ Object



116
117
118
# File 'lib/manacle/formatter.rb', line 116

def example_pending(notification)
  @pending_count += 1
end

#example_started(notification) ⇒ Object



104
105
106
# File 'lib/manacle/formatter.rb', line 104

def example_started(notification)
  @count += 1
end

#start(notification) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/manacle/formatter.rb', line 92

def start(notification)
  @examples = ExampleList.new
  @count = 0
  @passed_count = 0
  @failed_count = 0
  @pending_count = 0
end

#stop(notification) ⇒ Object



100
101
102
# File 'lib/manacle/formatter.rb', line 100

def stop(notification)
  @output << @examples.render
end