4
class TestOptionParser < Test::Unit::TestCase; end
5
class TestOptionParser::SummaryTest < Test::Unit::TestCase
8
o = OptionParser.new do |opts|
9
opts.on("-f", "--first-option", "description 1", "description 2"){r = "first-option"}
10
opts.on("-t", "--test-option"){r = "test-option"}
11
opts.on("-t", "--another-test-option"){r = "another-test-option"}
12
opts.separator "this is\nseparator"
13
opts.on("-l", "--last-option"){r = "last-option"}
17
assert_match(/--#{r}/, s.grep(/^\s*-t,/)[0])
18
assert_match(/first-option/, s[0])
19
assert_match(/description 1/, s[0])
20
assert_match(/description 2/, s[1])
21
assert_match(/last-option/, s[-1])