aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/arel/nodes/bind_param_test.rb
blob: 37a362ece4ebdd21ac07e8317e9de1d53e230b14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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