Sha256: ad5e39645f486a1232af7479e3d688e133e0d2e72150981f3d8af53b33332415

Contents?: true

Size: 1.14 KB

Versions: 50

Compression:

Stored size: 1.14 KB

Contents

require File.dirname(__FILE__) + '/helper'
require 'tinder'

class TestCampfire < Test::Unit::TestCase
  def test_exists
    God::Contacts::Campfire
  end
  
  # should notify
  def test_campfire_delivery_method_for_notify
    assert_nothing_raised do
      
      room = mock()
      room.expects(:speak).returns(nil)
      
      g = God::Contacts::Campfire.new
      God::Contacts::Campfire.format.expects(:call).with(:a,:e)
      g.expects(:room).returns(room)
      g.notify(:a, :b, :c, :d, :e)
      assert_equal "notified campfire: ", g.info
    end
  end
  
  # should not establish a new connection because the older is alive
  def test_campfire_room_method
   assert_nothing_raised do
     room = mock()
     g = God::Contacts::Campfire.new
     g.instance_variable_set(:@room,room)
     assert_equal g.send(:room), room
   end
  end
  
  # should raise because the connections parameters have not been set
  def test_campfire_delivery_method_for_notify_without_campfire_params
    LOG.expects(:log).times(3) # 3 calls: 2 debug (credentials, backtrace) + 1 info (failed message)
    g = God::Contacts::Campfire.new
    g.notify(:a, :b, :c, :d, :e)
  end
  
end

Version data entries

50 entries across 50 versions & 15 rubygems

Version Path
dguettler-god-0.7.13.2 test/test_campfire.rb
dguettler-god-0.7.13.3 test/test_campfire.rb
dunedain289-god-0.7.12.1 test/test_campfire.rb
eric-god-0.7.10 test/test_campfire.rb
eric-god-0.7.11 test/test_campfire.rb
eric-god-0.7.12 test/test_campfire.rb
eric-god-0.7.14 test/test_campfire.rb
fotonauts-god-0.7.10 test/test_campfire.rb
fotonauts-god-0.7.12 test/test_campfire.rb
gordoncww-god-0.7.11.1 test/test_campfire.rb
jreynolds-god-0.7.13 test/test_campfire.rb
mathieuravaux-god-0.7.11 test/test_campfire.rb
mojombo-god-0.7.10 test/test_campfire.rb
mojombo-god-0.7.11 test/test_campfire.rb
mojombo-god-0.7.12 test/test_campfire.rb
mojombo-god-0.7.13 test/test_campfire.rb
mojombo-god-0.7.14 test/test_campfire.rb
mojombo-god-0.7.15 test/test_campfire.rb
mojombo-god-0.7.16 test/test_campfire.rb
mojombo-god-0.7.20 test/test_campfire.rb