Sha256: d8e5c2890f7ff04c5a6c656d1abb05eb3cbbd1bd1e8282c6804f4f592e4897dc

Contents?: true

Size: 1.07 KB

Versions: 23

Compression:

Stored size: 1.07 KB

Contents

#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/helper'

class TestJabber < Test::Unit::TestCase

  def setup
    God::Contacts::Jabber.settings = { 
      :jabber_id => 'test@example.com',
      :password => 'pass'
    }
    @jabber = God::Contacts::Jabber.new
    @jabber.jabber_id = 'recipient@example.com'
  end

  def test_notify
    assert_nothing_raised do
      God::Contacts::Jabber.any_instance.expects(:connect!).once.returns(nil)
      God::Contacts::Jabber.any_instance.expects(:send!).once.returns(nil)
      @jabber.notify(:a, :b, :c, :d, :e)
      assert_equal "sent jabber message to recipient@example.com", @jabber.info
    end
  end
  
  # def test_live_notify
  #   God::Contacts::Jabber.settings = { 
  #     :jabber_id => 'real_user@example.com',
  #     :password => 'pass'
  #   }
  #   recipient = "real_recipient@example.com"
  #   
  #   jabber = God::Contacts::Jabber.new
  #   jabber.jabber_id = recipient
  #   jabber.notify("Hello", Time.now, "Test", "Test", "localhost")
  #   assert_equal "sent jabber message to #{recipient}", jabber.info
  # end
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
eric-god-0.7.14 test/test_jabber.rb
mojombo-god-0.7.14 test/test_jabber.rb
mojombo-god-0.7.15 test/test_jabber.rb
mojombo-god-0.7.16 test/test_jabber.rb
mojombo-god-0.7.20 test/test_jabber.rb
god-0.10.1 test/test_jabber.rb
god-0.9.0 test/test_jabber.rb
olgen-god-0.9.2 test/test_jabber.rb
olgen-god-0.9.1 test/test_jabber.rb
olgen-god-0.9.0 test/test_jabber.rb
god-0.8.0 test/test_jabber.rb
olgen-god-0.8.2 test/test_jabber.rb
olgen-god-0.8.1 test/test_jabber.rb
olgen-god-0.8.0 test/test_jabber.rb
god-0.7.22 test/test_jabber.rb
god-0.7.21 test/test_jabber.rb
god-0.7.20 test/test_jabber.rb
god-0.7.19 test/test_jabber.rb
god-0.7.18 test/test_jabber.rb
god-0.7.17 test/test_jabber.rb