Sha256: 2840ba65831b0a466738e5dbd7e2d6acba62ebdd046e76d6e3deee4d42e358b0

Contents?: true

Size: 797 Bytes

Versions: 17

Compression:

Stored size: 797 Bytes

Contents

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

class TestSocket < Test::Unit::TestCase
  def setup
    silence_warnings do 
      Object.const_set(:DRb, stub_everything)
    end
  end

  def test_should_start_a_drb_server
    DRb.expects(:start_service)
    God::Socket.new
  end

  def test_should_use_supplied_port_and_host
    DRb.expects(:start_service).with { |uri, object| uri == "drbunix:///tmp/god.9999.sock" && object.is_a?(God::Socket) }
    server = God::Socket.new(9999)
  end

  def test_should_forward_foreign_method_calls_to_god
    server = nil
    server = God::Socket.new
    God.expects(:send).with(:something_random)
    server.something_random
  end
  
  # ping
  
  def test_ping_should_return_true
    server = nil
    server = God::Socket.new
    assert server.ping
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
mojombo-god-0.7.20 test/test_socket.rb
firenxis-god-0.11.0 test/test_socket.rb
god-0.11.0 test/test_socket.rb
god-0.10.1 test/test_socket.rb
god-0.9.0 test/test_socket.rb
olgen-god-0.9.2 test/test_socket.rb
olgen-god-0.9.1 test/test_socket.rb
olgen-god-0.9.0 test/test_socket.rb
god-0.8.0 test/test_socket.rb
olgen-god-0.8.2 test/test_socket.rb
olgen-god-0.8.1 test/test_socket.rb
olgen-god-0.8.0 test/test_socket.rb
god-0.7.22 test/test_socket.rb
god-0.7.21 test/test_socket.rb
god-0.7.20 test/test_socket.rb
god-0.7.19 test/test_socket.rb
god-0.7.18 test/test_socket.rb