Skip to content

Commit

Permalink
test quoting strings with binary columns
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 12, 2010
1 parent 4804cb4 commit 2681dd8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions activerecord/test/cases/quoting_test.rb
Expand Up @@ -173,6 +173,19 @@ def test_quote_string_float_column
assert_equal "1.0", @quoter.quote('1', FakeColumn.new(:float))
assert_equal "1.2", @quoter.quote('1.2', FakeColumn.new(:float))
end

def test_quote_binary_without_string_to_binary
assert_equal "'lo\\\\l'", @quoter.quote('lo\l', FakeColumn.new(:binary))
end

def test_quote_binary_with_string_to_binary
col = Class.new(FakeColumn) {
def self.string_to_binary(value)
'foo'
end
}.new(:binary)
assert_equal "'foo'", @quoter.quote('lo\l', col)
end
end
end
end

0 comments on commit 2681dd8

Please sign in to comment.