From baa660f62b4fae9197d7b4b6e4bbcf4059d106a8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 2 Dec 2010 14:01:08 -0800 Subject: deprecating "insert" --- test/helper.rb | 2 +- test/test_table.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/helper.rb b/test/helper.rb index 3f9ac22447..f13596f9ec 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -8,6 +8,6 @@ Arel::Table.engine = Arel::Sql::Engine.new(FakeRecord::Base.new) class Object def must_be_like other - self.gsub(/\s+/, ' ').strip.must_equal other.gsub(/\s+/, ' ').strip + gsub(/\s+/, ' ').strip.must_equal other.gsub(/\s+/, ' ').strip end end diff --git a/test/test_table.rb b/test/test_table.rb index 8d37a8eaff..b9998174a1 100644 --- a/test/test_table.rb +++ b/test/test_table.rb @@ -6,6 +6,18 @@ module Arel @relation = Table.new(:users) end + it 'should return an insert manager' do + im = @relation.compile_insert 'VALUES(NULL)' + assert_kind_of Arel::InsertManager, im + assert_equal 'INSERT INTO NULL VALUES(NULL)', im.to_sql + end + + it 'should return IM from insert_manager' do + im = @relation.insert_manager + assert_kind_of Arel::InsertManager, im + assert_equal im.engine, @relation.engine + end + describe 'skip' do it 'should add an offset' do sm = @relation.skip 2 -- cgit v1.2.3