提交 26ec1be2 编写于 作者: J Jeremy Kemper

concat should ignore nil

上级 e732a405
......@@ -26,7 +26,7 @@ module TextHelper
# # will either display "Logged in!" or a login link
# %>
def concat(string)
if @output_buffer
if @output_buffer && string
@output_buffer << string
else
string
......
......@@ -11,6 +11,14 @@ def setup
@_cycles = nil if (defined? @_cycles)
end
def test_concat
@output_buffer = 'foo'
concat 'bar'
assert_equal 'foobar', @output_buffer
assert_nothing_raised { concat nil }
assert_equal 'foobar', @output_buffer
end
def test_simple_format
assert_equal "<p></p>", simple_format(nil)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册