Skip to content

Commit

Permalink
Suppress double dots.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Jun 28, 2014
1 parent f28a127 commit 1c58954
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lib/test/unit/assertions.rb
Expand Up @@ -450,7 +450,11 @@ def build_message(head, template=nil, *arguments) #:nodoc:
def message(msg = nil, *args, &default) # :nodoc:
if Proc === msg
super(nil, *args) do
[msg.call, (default.call if default)].compact.reject(&:empty?).join(".\n")
ary = [msg.call, (default.call if default)].compact.reject(&:empty?)
if 1 < ary.length
ary[0...-1] = ary[0...-1].map {|str| str.sub(/(?<!\.)\z/, '.') }
end
ary.join("\n")
end
else
super
Expand Down

0 comments on commit 1c58954

Please sign in to comment.