Sha256: e72e64883f7284563d61126f8c2cba68001bf5f2f870b0706ba2576ed80c98e0

Contents?: true

Size: 683 Bytes

Versions: 8

Compression:

Stored size: 683 Bytes

Contents

require 'test_helper'

class DispatcherTest < ChilloutTestCase
  def test_send_creations
    server_side = mock("ServerSide")
    server_side.expects(:send_measurements).with(:creations)

    dispatcher = Chillout::Dispatcher.new(server_side)
    dispatcher.send_measurements(:creations)
  end

  def test_send_creations_raise_exception_if_server_side_failed_to_send_request
    server_side = stub()
    server_side.stubs(:send_measurements).raises(Chillout::HttpClient::NotSent.new(:http_error))

    dispatcher = Chillout::Dispatcher.new(server_side)

    assert_raises Chillout::Dispatcher::SendCreationsFailed do
      dispatcher.send_measurements(:creations)
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
chillout-0.8.9 test/dispatcher_test.rb
chillout-0.8.5.1 test/dispatcher_test.rb
chillout-0.8.8 test/dispatcher_test.rb
chillout-0.8.7 test/dispatcher_test.rb
chillout-0.8.6 test/dispatcher_test.rb
chillout-0.8.5 test/dispatcher_test.rb
chillout-0.8.4 test/dispatcher_test.rb
chillout-0.8.3 test/dispatcher_test.rb