test/test_messenger.rb in messenger-0.0.3 vs test/test_messenger.rb in messenger-0.1.0

- old
+ new

@@ -2,21 +2,23 @@ module Messenger class MessengerTest < Test::Unit::TestCase - context "Protocol/Handler" do - should "determine the proper service" do - assert_equal :email, Messenger.protocol("mailto:test@example.com") - assert_equal :http, Messenger.protocol("http://example.com") - assert_equal :http, Messenger.protocol("https://example.com") - end + should "determine the proper protocol" do + assert_equal :email, Messenger.protocol("mailto:test@example.com") + assert_equal :http, Messenger.protocol("http://example.com") + assert_equal :http, Messenger.protocol("https://example.com") + assert_equal :jabber, Messenger.protocol("jabber://test@example.com") + assert_equal :campfire, Messenger.protocol("campfire://api_key:room_id@subdomain.campfirenow.com") + end - should "determine the proper notification handler given a protocol" do - assert_equal Email, Messenger.handler("mailto:test@example.com") - assert_equal Web, Messenger.handler("http://example.com") - assert_equal Web, Messenger.handler("https://example.com") - end + should "determine the proper notification handler given a protocol" do + assert_equal Email, Messenger.handler("mailto:test@example.com") + assert_equal Web, Messenger.handler("http://example.com") + assert_equal Web, Messenger.handler("https://example.com") + assert_equal Jabber, Messenger.handler("jabber://test@example.com") + assert_equal Campfire, Messenger.handler("campfire://api_key:room_id@subdomain.campfirenow.com") end end end