Sha256: 0d99751dfae408245e82f3125315b220f1cf40c958dcc7d1e32d3b9ca29c353d

Contents?: true

Size: 962 Bytes

Versions: 2

Compression:

Stored size: 962 Bytes

Contents

require 'test_helper'
require 'integrity/notifier/test'
require 'integrity/notifier/integrity-gnome-notify'

class IntegrityGnomeNotifyTest < Test::Unit::TestCase
  include Integrity::Notifier::Test

  context "A gnome-notify notifier" do
    setup { setup_database }

    should "register itself" do
      assert_equal Integrity::Notifier::GnomeNotify, 
                   Integrity::Notifier.available["GnomeNotify"]
    end

    [:successful, :failed, :pending].each do |status|
      should "send a notification after completing a #{status} build" do
        commit = Integrity::Commit.gen(status)
        notifier = Integrity::Notifier::GnomeNotify.new(commit, {})
        images_root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'images'))
        mock(notifier).system(/^notify-send "#{commit.project.name}" "#{notifier.short_message}" -i #{images_root}\/#{commit.status}.png -t 1000$/)
        notifier.deliver!
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
matflores-integrity-gnome-notify-0.1.1 test/integrity-gnome-notify_test.rb
matflores-integrity-gnome-notify-0.1.2 test/integrity-gnome-notify_test.rb