Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed tests.

  • Loading branch information...
commit b249500cd711fce0b8fd1c1e3104af82f78d9835 1 parent 208834c
Nathaniel Talbott authored
Showing with 14 additions and 12 deletions.
  1. +14 −12 test/test_drbfire.rb
26 test/test_drbfire.rb
View
@@ -40,34 +40,35 @@ class Front
include DRbUndumped
class Param
- include DRbUndumped
+ include DRbUndumped
- attr_reader :called
+ attr_reader :called
- def initialize
- @called = false
- end
+ def initialize
+ @called = false
+ end
- def n
- @called = true
- end
+ def n
+ @called = true
+ end
end
attr_reader :called, :param
def initialize
@called = 0
- @param = Param.new
+ @param = Param.new
end
def param_called
- @param.called
+ @param.called
end
def m(args={})
@called += 1
+
args[:back].m(:param => @param) if(args[:back])
- args[:param].n if(args[:param])
+ args[:param].n if(args[:param])
end
end
@@ -82,6 +83,7 @@ def check_communication
yield(config) if(block_given?)
begin
config.server = DRb.start_service(TEST_URI, config.front, config.server_config) if(config.start_server)
+ DRb.remove_server config.server # Hack to deal with running multiple servers in the same process - we always want the client server to be picked up.
client = nil
assert_nothing_raised do
timeout(1) do
@@ -96,7 +98,7 @@ def check_communication
end
end
assert(0 < config.front.called, "Server not called")
- assert(config.front.param_called, "Server not called back")
+ assert(config.front.param_called, "Server not called back")
assert_equal(1, back.called, "Client not called")
ensure
client.stop_service if(client)
Please sign in to comment.
Something went wrong with that request. Please try again.