From b9d4341bd00280f2bd33a9d55a82d8a28c1efd02 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 11 Oct 2010 17:08:40 -0700 Subject: starting to get the quote module under test --- activerecord/test/cases/quoting_test.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 activerecord/test/cases/quoting_test.rb (limited to 'activerecord') diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb new file mode 100644 index 0000000000..bfb287749c --- /dev/null +++ b/activerecord/test/cases/quoting_test.rb @@ -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 -- cgit v1.2.3