Changeset 34130

Show
Ignore:
Timestamp:
06/24/09 22:39:29 (4 years ago)
Author:
frsyuki
Message:

lang/ruby/chukan: update usage comments

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/chukan/trunk/chukan.rb

    r32759 r34130  
    3737 
    3838cli = spawn("client -arg1 -arg2")  # run 'client' command with some arguments 
    39 src.stdout_join("connected")       # wait until the server outputs "connected" 
     39srv.stdout_join("connected")       # wait until the server outputs "connected" 
    4040 
    4141cli.kill                           # send SIGKILL signal to the client 
    4242cli.join                           # wait until the client is really dead 
    43 srv.stderr_join(/disconnected/)    # stderr and regexp are also usable 
     43srv.stderr_join(/disconnected/)    # stderr and regexp are also available 
    4444 
    4545srv.stdin.write "status\n"         # input "status\n" to the server 
     
    4747 
    4848if srv.stdout.read =~ /^client:/   # read output of the server 
    49         puts "** TEST FAILED **"         # this library is usable for tests 
     49  puts "** TEST FAILED **"         # this library is usable for tests 
    5050                                   # see also "Unit test" example below 
    5151end 
     
    6969                                   # user name and path of the key is optional 
    7070 
    71 cli_on_mac   = mac.spawn("client -arg1")   # run cilent on the remote host 
     71cli_on_mac   = mac.spawn("client -arg1")   # run 'client' on the remote host 
    7272cli_on_linux = linux.spawn("client -arg1") 
    7373 
     
    8585 
    8686test "load mylibrary"  do          # Chukan::Test provides 'test' and 'run' methods 
    87         require "mylibrary"              # test will fail if the block returns nil or false, 
     87  require "mylibrary"              # test will fail if the block returns nil or false, 
    8888                                   # or an exception is raised 
    8989end 
    9090 
    91 run {|b|                           # 'run' iterates yaml documents written after 
     91run {|b|                           # 'run' iterates YAML documents written after 
    9292                                   # __END__ line 
    93         test "score <= 100", :TODO  do   # second argument of 'test' is :TODO or :SKIP 
    94                 b.score <= 100                 # which is useful for Test Anything Protocol 
    95         end                              # (TAP) processor like prove 
     93  test "score <= 100", :TODO  do   # second argument of 'test' is :TODO or :SKIP 
     94    b.score <= 100                 # which is useful for Test Anything Protocol 
     95  end                              # (TAP) processor like 'prove' 
    9696} 
    9797 
    9898__END__ 
    99 ---                                # yaml documents are here 
     99---                                # YAML documents are here 
    100100name:  test A 
    101101user:  a-san