Sha256: 9a76678fd5bfed2a1e0d89e0cef50f19067a9637fd6a427409fbee9a6de8d207

Contents?: true

Size: 685 Bytes

Versions: 5

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

require_relative "../helper"

module Arel
  module Nodes
    class GroupingTest < Arel::Spec
      it "should create Equality nodes" do
        grouping = Grouping.new(Nodes.build_quoted("foo"))
        _(grouping.eq("foo").to_sql).must_be_like "('foo') = 'foo'"
      end

      describe "equality" do
        it "is equal with equal ivars" do
          array = [Grouping.new("foo"), Grouping.new("foo")]
          assert_equal 1, array.uniq.size
        end

        it "is not equal with different ivars" do
          array = [Grouping.new("foo"), Grouping.new("bar")]
          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/grouping_test.rb
ibm_db-5.4.1 test/cases/arel/nodes/grouping_test.rb
ibm_db-5.4.0 test/cases/arel/nodes/grouping_test.rb
ibm_db-5.3.2 test/cases/arel/nodes/grouping_test.rb
ibm_db-5.3.1 test/cases/arel/nodes/grouping_test.rb