Skip to content

Commit

Permalink
Try to find libnotify.png bundled with gem itself
Browse files Browse the repository at this point in the history
  • Loading branch information
splattael committed May 12, 2011
1 parent 441dd42 commit 285d5ae
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/test_libnotify.rb
Expand Up @@ -61,20 +61,21 @@ def test_timeout_setter
end

def test_icon_path_setter
assert_icon_path "/some/path/image.jpg", "/some/path/image.jpg", "with absolute path"
assert_icon_path "some-invalid-path.jpg", "some-invalid-path.jpg", "with non-existant relative path"
assert_icon_path %r{^/.*/emblem-favorite.png}, "emblem-favorite.png", "with relative path"
assert_icon_path %r{^/.*/emblem-favorite.png}, :"emblem-favorite", "with symbol"
Libnotify::API.icon_dirs << File.expand_path("../..", __FILE__)
assert_icon_path "/some/path/image.jpg", "/some/path/image.jpg", "with absolute path"
assert_icon_path "some-invalid-path.jpg", "some-invalid-path.jpg", "with non-existant relative path"
assert_icon_path %r{^/.*/libnotify.png}, "libnotify.png", "with relative path"
assert_icon_path %r{^/.*/libnotify.png}, :"libnotify", "with symbol"
end

def test_integration
skip "enable integration"

libnotify = Libnotify::API.new(:timeout => 0.5, :icon_path => :"emblem-favorite", :append => true)

[ :low, :normal, :critical ].each do |urgency|
libnotify = Libnotify::API.new(:timeout => 0.5, :icon_path => :"emblem-favorite", :append => true)
libnotify.summary = "#{RUBY_VERSION} at #{RUBY_PLATFORM} #{urgency}"
libnotify.body = defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : '?'
libnotify.summary = "#{RUBY_VERSION} at #{RUBY_PLATFORM}"
libnotify.body = [ urgency, defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : '?' ].join(" ")
libnotify.urgency = urgency
libnotify.show!
end
Expand Down

0 comments on commit 285d5ae

Please sign in to comment.