Sha256: 104fbd912d78a1da2967a977ab14d667dcf023717c462ceba9f35614c602608e

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

require "#{File.dirname(__FILE__)}/test_helper"

module Messenger

  class MessengerTest < Test::Unit::TestCase

    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")
      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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
messenger-0.1.1 test/test_messenger.rb
messenger-0.1.0 test/test_messenger.rb