Sha256: e4a7305ce6e0eb197a6fb2a9cf44228bdbf028ac7b2be8f7beb8f90d89de564d

Contents?: true

Size: 814 Bytes

Versions: 5

Compression:

Stored size: 814 Bytes

Contents

# frozen_string_literal: true

require_relative "../helper"

module Arel
  module Nodes
    describe "table alias" do
      describe "equality" do
        it "is equal with equal ivars" do
          relation1 = Table.new(:users)
          node1     = TableAlias.new relation1, :foo
          relation2 = Table.new(:users)
          node2     = TableAlias.new relation2, :foo
          array = [node1, node2]
          assert_equal 1, array.uniq.size
        end

        it "is not equal with different ivars" do
          relation1 = Table.new(:users)
          node1     = TableAlias.new relation1, :foo
          relation2 = Table.new(:users)
          node2     = TableAlias.new relation2, :bar
          array = [node1, node2]
          assert_equal 2, array.uniq.size
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ibm_db-5.5.0 test/cases/arel/nodes/table_alias_test.rb
ibm_db-5.4.1 test/cases/arel/nodes/table_alias_test.rb
ibm_db-5.4.0 test/cases/arel/nodes/table_alias_test.rb
ibm_db-5.3.2 test/cases/arel/nodes/table_alias_test.rb
ibm_db-5.3.1 test/cases/arel/nodes/table_alias_test.rb