Class: NotifyOSDReporter

Inherits:
RSpec::Core::Formatters::ProgressFormatter
  • Object
show all
Defined in:
lib/adapters/rspec.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ NotifyOSDReporter

Returns a new instance of NotifyOSDReporter.



2
3
4
5
# File 'lib/adapters/rspec.rb', line 2

def initialize(output)
  super(output)
  @failed_specs = 0
end

Instance Method Details

#closeObject



13
14
15
16
17
18
19
# File 'lib/adapters/rspec.rb', line 13

def close
  if @failed_specs == 0
    `notify-send "Rspec: no failed specs", "No failed specs"`
  else
    `notify-send "Rspec: #{@failed_specs} failed specs", "#{@failed_specs} failed specs"`
  end
end

#example_failed(example) ⇒ Object



7
8
9
10
11
# File 'lib/adapters/rspec.rb', line 7

def example_failed(example)
  super(example)
  @failed_specs += 1
  `notify-send "Rspec: #{example.full_description}", "#{example.execution_result[:exception].message.gsub(/"/, "'")}"`
end