summaryrefslogtreecommitdiff
path: root/test/optparse
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-24 05:54:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-24 05:54:08 +0000
commita9917efd5d99d8ba7a8a573c1f6bfb024cfb316e (patch)
treed1f9224983718cfdb2f39d1e597982b9f35519fc /test/optparse
parent770ddcdfe069f8654a07e0fcc758aea591cdd17d (diff)
* lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
defined. [ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/optparse')
-rw-r--r--test/optparse/test_summary.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/optparse/test_summary.rb b/test/optparse/test_summary.rb
index 0c67d7f..bda3b49 100644
--- a/test/optparse/test_summary.rb
+++ b/test/optparse/test_summary.rb
@@ -18,4 +18,21 @@ class TestOptionParser::SummaryTest < TestOptionParser
assert_match(/description 2/, s[1])
assert_match(/last-option/, s[-1])
end
+
+ def test_banner
+ o = OptionParser.new("foo bar")
+ assert_equal("foo bar", o.banner)
+ end
+
+ def test_banner_from_progname
+ o = OptionParser.new
+ o.program_name = "foobar"
+ assert_equal("Usage: foobar [options]\n", o.help)
+ end
+
+ def test_summary
+ o = OptionParser.new("foo bar")
+ assert_equal("foo bar\n", o.to_s)
+ assert_equal(["foo bar"], o.to_a)
+ end
end