1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Implement equality for BindParam

It is impossible to test equality of things constructing trees with bind
params otherwise.
This commit is contained in:
Sean Griffin 2015-01-25 14:47:47 -07:00
parent 9d773cd116
commit d36a769234
2 changed files with 18 additions and 0 deletions

View file

@ -1,6 +1,9 @@
module Arel
module Nodes
class BindParam < Node
def ==(other)
other.is_a?(BindParam)
end
end
end
end

View file

@ -0,0 +1,15 @@
require 'helper'
module Arel
module Nodes
describe 'BindParam' do
it 'is equal to other bind params' do
BindParam.new.must_equal(BindParam.new)
end
it 'is not equal to other nodes' do
BindParam.new.wont_equal(Node.new)
end
end
end
end