aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/arel/nodes/bind_param.rb3
-rw-r--r--test/nodes/test_bind_param.rb15
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/arel/nodes/bind_param.rb b/lib/arel/nodes/bind_param.rb
index 160bc21b91..3a4aedc4ba 100644
--- a/lib/arel/nodes/bind_param.rb
+++ b/lib/arel/nodes/bind_param.rb
@@ -1,6 +1,9 @@
module Arel
module Nodes
class BindParam < Node
+ def ==(other)
+ other.is_a?(BindParam)
+ end
end
end
end
diff --git a/test/nodes/test_bind_param.rb b/test/nodes/test_bind_param.rb
new file mode 100644
index 0000000000..ea008f4c99
--- /dev/null
+++ b/test/nodes/test_bind_param.rb
@@ -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