424
423
assert_match(pattern, cmd.help(:verbose => true))
426
def test_run_with_raw_args
427
cmd = Cri::Command.define do
430
puts "args=#{args.join(',')} args.raw=#{args.raw.join(',')}"
434
out, err = capture_io_while do
435
cmd.run(%w( foo -- bar ))
437
assert_equal "args=foo,bar args.raw=foo,--,bar\n", out
440
def test_run_without_block
441
cmd = Cri::Command.define do
445
assert_raises(Cri::NotImplementedError) do
450
def test_runner_with_raw_args
451
cmd = Cri::Command.define do
453
runner(Class.new(Cri::CommandRunner) do
455
puts "args=#{arguments.join(',')} args.raw=#{arguments.raw.join(',')}"
460
out, err = capture_io_while do
461
cmd.run(%w( foo -- bar ))
463
assert_equal "args=foo,bar args.raw=foo,--,bar\n", out
467
foo = Cri::Command.define { name 'foo' }
468
bar = Cri::Command.define { name 'bar' }
469
qux = Cri::Command.define { name 'qux' }
471
assert_equal [ bar, foo, qux ], [ foo, bar, qux ].sort