mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
93d72131bc
If we add the casting node to the ast at build time, then we can avoid doing the lookup at visit time.
25 lines
633 B
Ruby
25 lines
633 B
Ruby
require 'helper'
|
|
|
|
module Arel
|
|
module Nodes
|
|
describe 'Grouping' do
|
|
it 'should create Equality nodes' do
|
|
grouping = Grouping.new(Nodes.build_quoted('foo'))
|
|
grouping.eq('foo').to_sql.must_be_like %q{('foo') = 'foo'}
|
|
end
|
|
|
|
describe 'equality' do
|
|
it 'is equal with equal ivars' do
|
|
array = [Grouping.new('foo'), Grouping.new('foo')]
|
|
assert_equal 1, array.uniq.size
|
|
end
|
|
|
|
it 'is not equal with different ivars' do
|
|
array = [Grouping.new('foo'), Grouping.new('bar')]
|
|
assert_equal 2, array.uniq.size
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|