Sha256: 2d5956be0a2c9e1f6d5ed4f220465233c79e5156b59d7cf41c7d863c51852b15

Contents?: true

Size: 626 Bytes

Versions: 4

Compression:

Stored size: 626 Bytes

Contents

require 'spec/runner/formatter/base_formatter'
require File.dirname(__FILE__) + '/rspactor/growl'

class RSpecGrowler < Spec::Runner::Formatter::BaseFormatter
  include RSpactor::Growl
  
  def dump_summary(duration, total, failures, pending)
    icon = if failures > 0
      'failed'
    elsif pending > 0
      'pending'
    else
      'success'
    end
    
    image_path = File.dirname(__FILE__) + "/../images/#{icon}.png"
    message = "#{total} examples, #{failures} failures"
    
    if pending > 0
      message << " (#{pending} pending)"
    end
    
    notify "Test Results", message, image_path(icon)
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
guillaumegentil-rspactor-0.3.4 lib/rspec_growler.rb
lacomartincik-rspactor-0.3.3.1 lib/rspec_growler.rb
lacomartincik-rspactor-0.3.3.2 lib/rspec_growler.rb
mislav-rspactor-0.4.0 lib/rspec_growler.rb