Class: RspecCountFormatter

Inherits:
RSpec::Core::Formatters::BaseTextFormatter
  • Object
show all
Defined in:
lib/rspec_count_formatter.rb

Instance Method Summary collapse

Instance Method Details

#example_failed(notification) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/rspec_count_formatter.rb', line 30

def example_failed(notification)
  @failed += 1

  output.puts notification.fully_formatted(@failed)
  output.puts

  status(notification.example.id)
end

#example_passed(notification) ⇒ Object



18
19
20
21
22
# File 'lib/rspec_count_formatter.rb', line 18

def example_passed(notification)
  @passed += 1

  status(notification.example.id)
end

#example_pending(notification) ⇒ Object



24
25
26
27
28
# File 'lib/rspec_count_formatter.rb', line 24

def example_pending(notification)
  @pending += 1

  status(notification.example.id)
end

#start(notification) ⇒ Object



11
12
13
14
15
16
# File 'lib/rspec_count_formatter.rb', line 11

def start(notification)
  @total   = notification.count
  @passed  = 0
  @pending = 0
  @failed  = 0
end