mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
starting to get the quote module under test
This commit is contained in:
30
activerecord/test/cases/quoting_test.rb
Normal file
30
activerecord/test/cases/quoting_test.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require "cases/helper"
|
||||
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
class QuotingTest < ActiveRecord::TestCase
|
||||
def setup
|
||||
@quoter = Class.new { include Quoting }.new
|
||||
end
|
||||
|
||||
def test_quoted_true
|
||||
assert_equal "'t'", @quoter.quoted_true
|
||||
end
|
||||
|
||||
def test_quoted_false
|
||||
assert_equal "'f'", @quoter.quoted_false
|
||||
end
|
||||
|
||||
def test_quote_column_name
|
||||
assert_equal "foo", @quoter.quote_column_name('foo')
|
||||
end
|
||||
|
||||
def test_quote_string
|
||||
assert_equal "''", @quoter.quote_string("'")
|
||||
assert_equal "\\\\", @quoter.quote_string("\\")
|
||||
assert_equal "hi''i", @quoter.quote_string("hi'i")
|
||||
assert_equal "hi\\\\i", @quoter.quote_string("hi\\i")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user