diff options
Diffstat (limited to 'spec/arel/unit/relations/take_spec.rb')
-rw-r--r-- | spec/arel/unit/relations/take_spec.rb | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/spec/arel/unit/relations/take_spec.rb b/spec/arel/unit/relations/take_spec.rb index dca7806057..911b84e01e 100644 --- a/spec/arel/unit/relations/take_spec.rb +++ b/spec/arel/unit/relations/take_spec.rb @@ -9,11 +9,23 @@ module Arel describe '#to_sql' do it "manufactures sql with limit and offset" do - Take.new(@relation, @taken).to_s.should be_like(" - SELECT `users`.`id`, `users`.`name` - FROM `users` - LIMIT #{@taken} - ") + sql = Take.new(@relation, @taken).to_s + + adapter_is :mysql do + sql.should be_like(%Q{ + SELECT `users`.`id`, `users`.`name` + FROM `users` + LIMIT 4 + }) + end + + adapter_is_not :mysql do + sql.should be_like(%Q{ + SELECT "users"."id", "users"."name" + FROM "users" + LIMIT 4 + }) + end end end end |