Stop skipping broken tests
[ruby.git] / sample / drb / drbch.rb
blob07fdcd5fae1e678f87e951763c7605c16603dea1
1 =begin
2  distributed Ruby --- dRuby Sample Client
3         Copyright (c) 1999-2000 Masatoshi SEKI
4 =end
6 require 'drb/drb'
7 require 'drb/http'
9 class DRbEx2
10   include DRbUndumped
12   def initialize(n)
13     @n = n
14   end
16   def to_i
17     @n.to_i
18   end
19 end
21 if __FILE__ == $0
22   there = ARGV.shift
23   unless there
24     $stderr.puts("usage: #{$0} <server_uri>")
25     exit 1
26   end
28   DRb::DRbConn.proxy_map['x68k'] = 'http://x68k/~mas/http_cgi.rb'
30   DRb.start_service()
31   ro = DRbObject.new(nil, there)
33   puts ro
34   p ro.to_a
35   puts ro.hello
36   p ro.hello
37   puts ro.sample(DRbEx2.new(1), 2, 3)
38   puts ro.sample(1, ro.sample(DRbEx2.new(1), 2, 3), DRbEx2.new(3))
40   begin
41     ro.err
42   rescue DRb::DRbUnknownError
43     p $!
44     p $!.unknown
45   rescue RuntimeError
46     p $!
47   end
48 end