aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/helper.rb2
-rw-r--r--test/test_table.rb12
2 files changed, 13 insertions, 1 deletions
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