diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-12 11:25:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-12 11:25:20 -0700 |
commit | 07b0b5b33067d51cab2dbfcfa0d7ae5bd787bd53 (patch) | |
tree | 10d9ee5724652e3a6a7d322e9689fcf35a2cfa9f | |
parent | 1ba3489b7528dd562393bbc9997d3e39f7b74f6b (diff) | |
download | rails-07b0b5b33067d51cab2dbfcfa0d7ae5bd787bd53.tar.gz rails-07b0b5b33067d51cab2dbfcfa0d7ae5bd787bd53.tar.bz2 rails-07b0b5b33067d51cab2dbfcfa0d7ae5bd787bd53.zip |
testing crazy object quoting
-rw-r--r-- | activerecord/test/cases/quoting_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb index ded03cd61b..8412a2b417 100644 --- a/activerecord/test/cases/quoting_test.rb +++ b/activerecord/test/cases/quoting_test.rb @@ -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 |