Sha256: fafe047c1c3f2dd85201c93ed9587a3eae1639e0b54397a17a06dd60f7feb150

Contents?: true

Size: 747 Bytes

Versions: 4

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

require_relative "../helper"

module Arel
  module Nodes
    class NodesTest < Arel::Spec
      describe "Binary" do
        describe "#hash" do
          it "generates a hash based on its value" do
            eq = Equality.new("foo", "bar")
            eq2 = Equality.new("foo", "bar")
            eq3 = Equality.new("bar", "baz")

            assert_equal eq.hash, eq2.hash
            assert_not_equal eq.hash, eq3.hash
          end

          it "generates a hash specific to its class" do
            eq = Equality.new("foo", "bar")
            neq = NotEqual.new("foo", "bar")

            assert_not_equal eq.hash, neq.hash
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/cases/arel/nodes/binary_test.rb
ibm_db-5.4.1-x86-mingw32 test/cases/arel/nodes/binary_test.rb
ibm_db-5.4.0-x86-mingw32 test/cases/arel/nodes/binary_test.rb
ibm_db-5.3.2-x86-mingw32 test/cases/arel/nodes/binary_test.rb