1 require File.dirname(__FILE__) + '/helper'
3 class TestServer < Test::Unit::TestCase
6 Object.const_set(:DRb, stub_everything)
10 def test_should_start_a_drb_server
11 DRb.expects(:start_service)
17 def test_should_use_supplied_port_and_host
18 DRb.expects(:start_service).with { |uri, object| uri == "druby://host:port" && object.is_a?(Server) }
20 server = Server.new('host', 'port')
24 def test_should_forward_foreign_method_calls_to_god
29 God.expects(:send).with(:something_random)
30 server.something_random
33 def test_should_install_deny_all_by_default
34 ACL.expects(:new).with(%w{deny all})
40 def test_should_install_pass_through_acl
41 ACL.expects(:new).with(%w{deny all allow 127.0.0.1 allow 0.0.0.0})
43 Server.new(nil, 17165, %w{127.0.0.1 0.0.0.0})
49 def test_ping_should_return_true