diff options
Diffstat (limited to 'spec/engines/sql/unit/predicates')
-rw-r--r-- | spec/engines/sql/unit/predicates/in_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/engines/sql/unit/predicates/in_spec.rb b/spec/engines/sql/unit/predicates/in_spec.rb index 5d9b2cdcaa..f62ee6e829 100644 --- a/spec/engines/sql/unit/predicates/in_spec.rb +++ b/spec/engines/sql/unit/predicates/in_spec.rb @@ -99,6 +99,28 @@ module Arel end end end + + describe 'when relating to a range with an excluded end' do + before do + @range = 1...3 + end + + it 'manufactures sql with a >= and <' do + sql = In.new(@attribute, @range).to_sql + + adapter_is :mysql do + sql.should be_like(%Q{(`users`.`id` >= 1 AND `users`.`id` < 3)}) + end + + adapter_is :oracle do + sql.should be_like(%Q{("USERS"."ID" >= 1 AND "USERS"."ID" < 3)}) + end + + adapter_is_not :mysql, :oracle do + sql.should be_like(%Q{("users"."id" >= 1 AND "users"."id" < 3)}) + end + end + end describe 'when relating to a time range' do before do |