зеркало из https://github.com/github/ruby.git
* lib/optparse.rb (OptionParser#to_a): should split by end-of-line
[ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a9917efd5d
Коммит
4f2b00429e
|
@ -1,4 +1,7 @@
|
|||
Tue Apr 24 14:54:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Tue Apr 24 15:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/optparse.rb (OptionParser#to_a): should split by end-of-line
|
||||
[ruby-dev:45568][Bug #6348]
|
||||
|
||||
* lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
|
||||
defined. [ruby-dev:45568][Bug #6348]
|
||||
|
|
|
@ -1071,7 +1071,7 @@ XXX
|
|||
#
|
||||
# Returns option summary list.
|
||||
#
|
||||
def to_a; summarize([*banner]) end
|
||||
def to_a; summarize("#{banner}".split(/$/)) end
|
||||
|
||||
#
|
||||
# Checks if an argument is given twice, in which case an ArgumentError is
|
||||
|
|
|
@ -31,8 +31,8 @@ class TestOptionParser::SummaryTest < TestOptionParser
|
|||
end
|
||||
|
||||
def test_summary
|
||||
o = OptionParser.new("foo bar")
|
||||
assert_equal("foo bar\n", o.to_s)
|
||||
assert_equal(["foo bar"], o.to_a)
|
||||
o = OptionParser.new("foo\nbar")
|
||||
assert_equal("foo\nbar\n", o.to_s)
|
||||
assert_equal(["foo", "bar"], o.to_a)
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче