Mock out what we need from AR::Base.

Namespace
Methods
N
S
T
Class Public methods
new()
# File activerecord/test/cases/quoting_test.rb, line 164
def initialize; @lol = 'lo\l' end
Instance Public methods
string_to_binary(value)
# File activerecord/test/cases/quoting_test.rb, line 199
def string_to_binary(value)
  'foo'
end
test_crazy_object()
# File activerecord/test/cases/quoting_test.rb, line 156
def test_crazy_object
  crazy = Class.new.new
  expected = "'#{YAML.dump(crazy)}'"
  assert_equal expected, @quoter.quote(crazy, nil)
  assert_equal expected, @quoter.quote(crazy, Object.new)
end
test_crazy_object_calls_quote_string()
# File activerecord/test/cases/quoting_test.rb, line 163
def test_crazy_object_calls_quote_string
  crazy = Class.new { def initialize; @lol = 'lo\l' end }.new
  assert_match "lo\\\\l", @quoter.quote(crazy, nil)
  assert_match "lo\\\\l", @quoter.quote(crazy, Object.new)
end
test_quote_as_mb_chars_binary_column()
# File activerecord/test/cases/quoting_test.rb, line 188
def test_quote_as_mb_chars_binary_column
  string = ActiveSupport::Multibyte::Chars.new('lo\l')
  assert_equal "'lo\\\\l'", @quoter.quote(string, FakeColumn.new(:binary))
end
test_quote_as_mb_chars_binary_column_with_string_to_binary()
# File activerecord/test/cases/quoting_test.rb, line 206
def test_quote_as_mb_chars_binary_column_with_string_to_binary
  col = Class.new(FakeColumn) {
    def string_to_binary(value)
      'foo'
    end
  }.new(:binary)
  string = ActiveSupport::Multibyte::Chars.new('lo\l')
  assert_equal "'foo'", @quoter.quote(string, col)
end
test_quote_as_mb_chars_no_column()
# File activerecord/test/cases/quoting_test.rb, line 173
def test_quote_as_mb_chars_no_column
  string = ActiveSupport::Multibyte::Chars.new('lo\l')
  assert_equal "'lo\\\\l'", @quoter.quote(string, nil)
end
test_quote_binary_with_string_to_binary()
# File activerecord/test/cases/quoting_test.rb, line 197
def test_quote_binary_with_string_to_binary
  col = Class.new(FakeColumn) {
    def string_to_binary(value)
      'foo'
    end
  }.new(:binary)
  assert_equal "'foo'", @quoter.quote('lo\l', col)
end
test_quote_binary_without_string_to_binary()
# File activerecord/test/cases/quoting_test.rb, line 193
def test_quote_binary_without_string_to_binary
  assert_equal "'lo\\\\l'", @quoter.quote('lo\l', FakeColumn.new(:binary))
end
test_quote_string_float_column()
# File activerecord/test/cases/quoting_test.rb, line 183
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
test_quote_string_int_column()
# File activerecord/test/cases/quoting_test.rb, line 178
def test_quote_string_int_column
  assert_equal "1", @quoter.quote('1', FakeColumn.new(:integer))
  assert_equal "1", @quoter.quote('1.2', FakeColumn.new(:integer))
end
test_quote_string_no_column()
# File activerecord/test/cases/quoting_test.rb, line 169
def test_quote_string_no_column
  assert_equal "'lo\\\\l'", @quoter.quote('lo\l', nil)
end
test_string_with_crazy_column()
# File activerecord/test/cases/quoting_test.rb, line 216
def test_string_with_crazy_column
  assert_equal "'lo\\\\l'", @quoter.quote('lo\l', FakeColumn.new(:foo))
end