Sha256: 8645a1ec968f3c9d2ef370518c0bad35f781d5bb35ad20476cf52bfe0b8cdb40

Contents?: true

Size: 1001 Bytes

Versions: 24

Compression:

Stored size: 1001 Bytes

Contents

require File.dirname(__FILE__) + "/../../test_helper"

unit_tests do
  test "show_status renders status of all servers as html" do
    status = DeepTest::Distributed::TestServerStatus.new(
      "binding_uri", 
      5,
      3
    )

    test_server = mock(:__drburi => "drburi_1", :status => status) 
    server = DeepTest::Distributed::MasterTestServer.new([test_server])
    res = WEBrick::HTTPResponse.new(WEBrick::Config::HTTP)
    server.show_status(:req, res)

    assert_match "<td>binding_uri</td>", res.body
    assert_match "<td>5</td>", res.body
    assert_match "<td>3</td>", res.body
  end

  test "show_status display error message if exception occurs" do
    test_server = mock(:__drburi => "drburi_1")
    test_server.expects(:status).raises("An Error")

    server = DeepTest::Distributed::MasterTestServer.new([test_server])

    res = WEBrick::HTTPResponse.new(WEBrick::Config::HTTP)
    server.show_status(:req, res)

    assert_match /<td.*?>An Error<\/td>/, res.body
  end
end

Version data entries

24 entries across 24 versions & 4 rubygems

Version Path
jason-o-matic-deep_test-1.2.2.1 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.10 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.11 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.12 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.13 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.14 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.2 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.3 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.4 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.5 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.6 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.7 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.8 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.9 test/deep_test/distributed/master_test_server_test.rb
jperkins-deep_test-1.2.2 test/deep_test/distributed/master_test_server_test.rb
jason-o-matic-deep_test-1.2.2.15 test/deep_test/distributed/master_test_server_test.rb
jstorimer-deep-test-1.4.0 test/deep_test/distributed/master_test_server_test.rb
jstorimer-deep-test-1.3.0 test/deep_test/distributed/master_test_server_test.rb
jstorimer-deep-test-1.2.0 test/deep_test/distributed/master_test_server_test.rb
jstorimer-deep-test-1.1.0 test/deep_test/distributed/master_test_server_test.rb