diff options
Diffstat (limited to 'activerecord/test/cases/arel/nodes/bind_param_test.rb')
-rw-r--r-- | activerecord/test/cases/arel/nodes/bind_param_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/activerecord/test/cases/arel/nodes/bind_param_test.rb b/activerecord/test/cases/arel/nodes/bind_param_test.rb new file mode 100644 index 0000000000..665581edce --- /dev/null +++ b/activerecord/test/cases/arel/nodes/bind_param_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +require_relative '../helper' + +module Arel + module Nodes + describe 'BindParam' do + it 'is equal to other bind params with the same value' do + BindParam.new(1).must_equal(BindParam.new(1)) + BindParam.new("foo").must_equal(BindParam.new("foo")) + end + + it 'is not equal to other nodes' do + BindParam.new(nil).wont_equal(Node.new) + end + + it 'is not equal to bind params with different values' do + BindParam.new(1).wont_equal(BindParam.new(2)) + end + end + end +end |