Sha256: 507b705e1ba1dda204bbeb3b4036426f78a4eb763451815c444047fb7c1dacba
Contents?: true
Size: 451 Bytes
Versions: 18
Compression:
Stored size: 451 Bytes
Contents
# Test facets/getoptlong.rb require 'facets/getoptlong.rb' require 'test/unit' class TestGetoptShort < Test::Unit::TestCase def test_dsl ARGV.replace(['foo', '--expect', 'A', '-h', 'nothing']) opts = GetoptLong.new do reqs '--expect', '-x' flag '--help', '-h' end ch = {} opts.each { |opt, arg| ch[opt] = arg } assert_equal( 'A', ch['--expect'] ) assert_equal( '', ch['--help'] ) end end
Version data entries
18 entries across 18 versions & 1 rubygems