Module: Argv::Etest

Defined in:
lib/vex/base/argv.rb

Instance Method Summary collapse

Instance Method Details

#test_argvObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vex/base/argv.rb', line 61

def test_argv
  args = Argv.new(%w(test))
  assert_equal [ "test" ], args.files

  args = Argv.new(%w(test1 test2 --no-xy))
  assert_equal [ "test1", "test2" ], args.files
  assert_equal false, args[:xy]
  assert_nil args[:bla]

  assert_equal false, args.xy
  assert_raises(NoMethodError) { args.bla }
end