Class: Swat::UI::RspecSetup::Formatter

Inherits:
RSpec::Core::Formatters::BaseFormatter
  • Object
show all
Defined in:
lib/swat/ui/rspec_setup.rb

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ Formatter

Returns a new instance of Formatter.



13
14
15
16
# File 'lib/swat/ui/rspec_setup.rb', line 13

def initialize(arg)
  super arg
  @stats_collector = StatsCollector.create
end

Instance Method Details

#example_failed(notification) ⇒ Object



22
23
24
# File 'lib/swat/ui/rspec_setup.rb', line 22

def example_failed(notification)
  @stats_collector.collect_case(notification.example)
end

#example_passed(notification) ⇒ Object



18
19
20
# File 'lib/swat/ui/rspec_setup.rb', line 18

def example_passed(notification)
  @stats_collector.collect_case(notification.example)
end

#example_started(notification) ⇒ Object



34
# File 'lib/swat/ui/rspec_setup.rb', line 34

def example_started(notification); end

#start(notification) ⇒ Object



30
31
32
# File 'lib/swat/ui/rspec_setup.rb', line 30

def start(notification)
  @stats_collector.collect_started_thread(notification)
end

#stop(notification) ⇒ Object



26
27
28
# File 'lib/swat/ui/rspec_setup.rb', line 26

def stop(notification)
  @stats_collector.collect_ended_thread(notification)
end