Sha256: f60c475aeadec7a59394342cc4f992ce28e00507c7fa592c58aae720c4de1132
Contents?: true
Size: 1 KB
Versions: 24
Compression:
Stored size: 1 KB
Contents
require File.dirname(__FILE__) + "/../../test_helper" unit_tests do test "returns ipaddress from peeraddr as address" do info = Thread.current['DRb'] begin Thread.current['DRb'] = { 'client' => mock(:peeraddr => [nil, nil, nil, "ip"]) } info = DeepTest::Distributed::DRbClientConnectionInfo.new ensure Thread.current['DRb'] = info end assert_equal "ip", info.address end test "raises an error if no drb client is found" do info = Thread.current['DRb'] begin Thread.current['DRb'] = {} assert_raises(RuntimeError) do DeepTest::Distributed::DRbClientConnectionInfo.new end ensure Thread.current['DRb'] = info end end test "raises an error if no drb info is found" do info = Thread.current['DRb'] begin Thread.current['DRb'] = nil assert_raises(RuntimeError) do DeepTest::Distributed::DRbClientConnectionInfo.new end ensure Thread.current['DRb'] = info end end end
Version data entries
24 entries across 24 versions & 4 rubygems