require "guard/rspec/formatter"

class Guard::JRubyRSpec::Formatter::NotificationRSpec < Guard::RSpec::Formatter

  def dump_summary(duration, total, failures, pending)
    message = guard_message(total, failures, pending, duration)
    image   = guard_image(failures, pending)
    notify(message, image)
  end

end

require "guard/rspec/formatter"

superclass = if Guard::RSpec::Formatter.instance_of? Module # guard-rspec-1.x
               Object
             elsif Guard::RSpec::Formatter.instance_of? Class # guard-rspec-2.x
               Guard::RSpec::Formatter
             else
               fail 'Guard::RSpec::Formatter is neither class nor module'
             end

class Guard::JRubyRSpec::Formatter::NotificationRSpec < superclass
  include Guard::RSpec::Formatter if Guard::RSpec::Formatter.instance_of? Module

  def dump_summary(duration, total, failures, pending)
    message = guard_message(total, failures, pending, duration)
    image   = guard_image(failures, pending)
    notify(message, image)
  end

end

Support both guard-rspec 1.x and 2.x
Support both guard-rspec 1.x and 2.x

Related:
https://github.com/guard/guard-rspec/commit/31e1be02503c51ed37aeda486866550f7f8395d2#diff-5
