test/libnotify/api_test.rb in libnotify-0.8.3 vs test/libnotify/api_test.rb in libnotify-0.8.4

- old
+ new

@@ -36,22 +36,29 @@ assert_timeout nil, false, "with false" assert_timeout 2, :"2 s", "with to_s.to_i" end test "icon_path=" do - Libnotify::API.icon_dirs << File.expand_path("../../..", __FILE__) + Libnotify::API.icon_dirs << File.expand_path("../../fixtures", __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" + assert_icon_path %r{^/.*/test/fixtures/libnotify.png}, "libnotify.png", "with relative path" + assert_icon_path %r{^/.*/test/fixtures/libnotify.png}, :"libnotify", "with symbol" end test "update" do libnotify(:summary => "hello", :body => "world").show! libnotify.update(:summary => "hell") do |n| n.body = "yeah" end assert_equal "hell", libnotify.summary assert_equal "yeah", libnotify.body libnotify.close + end + + test "raise ArgumentError for unknown urgency" do + e = assert_raises ArgumentError do + libnotify(:urgency => :unknown).show! + end + assert_equal "invalid enum value, :unknown", e.message end end