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

Version Path
facets-2.9.2 work/todo/more/test_getoptlong.rb
facets-2.8.4 test/more/test_getoptlong.rb
facets-2.8.3 test/more/test_getoptlong.rb
facets-2.8.2 test/more/test_getoptlong.rb
facets-2.8.1 test/more/test_getoptlong.rb
facets-2.8.0 test/more/test_getoptlong.rb
facets-2.7.0 test/more/test_getoptlong.rb
facets-2.6.0 test/more/test_getoptlong.rb
facets-2.3.0 test/more/test_getoptlong.rb
facets-2.4.0 test/test_getoptlong.rb
facets-2.4.1 test/test_getoptlong.rb
facets-2.4.3 test/more/test_getoptlong.rb
facets-2.4.2 test/more/test_getoptlong.rb
facets-2.4.4 test/more/test_getoptlong.rb
facets-2.5.0 test/more/test_getoptlong.rb
facets-2.4.5 test/more/test_getoptlong.rb
facets-2.5.1 test/more/test_getoptlong.rb
facets-2.5.2 test/more/test_getoptlong.rb