blob: d6442fc9d14587e3f55d9a977be8d2ab9326c407 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
module Arel
describe Take do
before do
@relation = Table.new(:users)
@taken = 4
end
describe '#to_sql' do
it "manufactures sql with limit and offset" do
sql = Take.new(@relation, @taken).to_sql
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
end
|