mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
testing crazy object quoting
This commit is contained in:
parent
1ba3489b75
commit
07b0b5b330
1 changed files with 12 additions and 0 deletions
|
@ -144,6 +144,18 @@ module ActiveRecord
|
|||
assert_equal "'lol'", @quoter.quote(DateTime.now, nil)
|
||||
assert_equal "'lol'", @quoter.quote(DateTime.now, Object.new)
|
||||
end
|
||||
|
||||
def test_crazy_object
|
||||
crazy = Class.new { def to_s; 'lol' end }.new
|
||||
assert_equal "'lol'", @quoter.quote(crazy, nil)
|
||||
assert_equal "'lol'", @quoter.quote(crazy, Object.new)
|
||||
end
|
||||
|
||||
def test_crazy_object_calls_quote_string
|
||||
crazy = Class.new { def to_s; 'lo\l' end }.new
|
||||
assert_equal "'lo\\\\l'", @quoter.quote(crazy, nil)
|
||||
assert_equal "'lo\\\\l'", @quoter.quote(crazy, Object.new)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue