Sha256: fea8c5f1e0d0ff7b7ed87bb91cb4ad5d433c1e1d92c578ca4cca562c2ae75964

Contents?: true

Size: 902 Bytes

Versions: 10

Compression:

Stored size: 902 Bytes

Contents

require 'rubygems'
require 'bundler/setup'
require 'minitest/autorun'
require 'minitest/libnotify'

require 'libnotify'

module LibnotifyAssertions
  def assert_timeout(expected, value, message)
    assert_value_set :timeout, expected, value, message
  end

  def assert_icon_path(expected, value, message)
    assert_value_set :icon_path, expected, value, message
  end

  def assert_value_set(attribute, expected, value, message)
    libnotify.send("#{attribute}=", value)
    got = libnotify.send(attribute)
    case expected
    when Regexp
      assert_match expected, got, message
    else
      assert_equal expected, got, message
    end
  end
end

class LibnotifyTestCase < MiniTest::Spec
  include LibnotifyAssertions

  class << self
    alias :test :it
    alias :context :describe
  end

  def libnotify(options={}, &block)
    @libnotify ||= Libnotify::API.new(options, &block)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
libnotify-0.8.0 test/helper.rb
libnotify-0.8.0.pre test/helper.rb
libnotify-0.7.4 test/helper.rb
libnotify-0.7.4.pre test/helper.rb
libnotify-0.7.3-universal-rubinius-1.2 test/helper.rb
libnotify-0.7.3 test/helper.rb
libnotify-0.7.2-universal-rubinius-1.2 test/helper.rb
libnotify-0.7.2 test/helper.rb
libnotify-0.7.1-universal-rubinius-1.2 test/helper.rb
libnotify-0.7.1 test/helper.rb