Sha256: 95de76e73b5c00c9340901e2db43737a503cdd1a481996314ab3f764a7d41811

Contents?: true

Size: 579 Bytes

Versions: 6

Compression:

Stored size: 579 Bytes

Contents

require "minitest/autorun"
require "cognition"
require "test_helper"

class ResponderTest < Minitest::Test
  def test_sends_reply
    stub_request(:any, "http://foo.bar/path")
      .to_return(status: 200)
    responder = Cognition::Responder.new("http://foo.bar/path")

    assert_equal 200, responder.reply("foobar").code
  end

  def test_handles_timeouts
    stub_request(:any, "http://foo.bar/path").to_timeout
    responder = Cognition::Responder.new("http://foo.bar/path")

    assert_equal "Request to http://foo.bar/path timed out.", responder.reply("foobar")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cognition-2.1.3 test/test_responder.rb
cognition-2.1.2 test/test_responder.rb
cognition-2.0.8 test/test_responder.rb
cognition-2.0.7 test/test_responder.rb
cognition-2.0.6 test/test_responder.rb
cognition-2.0.5 test/test_responder.rb