Sha256: c5a6344efd0588633c0694e42f5fbca1ee3103a7ddc7fd489779abbaf4b549a7

Contents?: true

Size: 868 Bytes

Versions: 5

Compression:

Stored size: 868 Bytes

Contents

require 'helper'

module Arel
  module Nodes
    class TestSelectCore < MiniTest::Unit::TestCase
      def test_clone
        core = Arel::Nodes::SelectCore.new
        core.froms       = %w[a b c]
        core.projections = %w[d e f]
        core.wheres      = %w[g h i]

        dolly = core.clone

        dolly.froms.must_equal core.froms
        dolly.projections.must_equal core.projections
        dolly.wheres.must_equal core.wheres

        dolly.froms.wont_be_same_as core.froms
        dolly.projections.wont_be_same_as core.projections
        dolly.wheres.wont_be_same_as core.wheres
      end

      def test_set_quantifier
        core = Arel::Nodes::SelectCore.new
        core.set_quantifier = Arel::Nodes::Distinct.new
        viz = Arel::Visitors::ToSql.new Table.engine
        assert_match 'DISTINCT', viz.accept(core)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arel-2.1.4 test/nodes/test_select_core.rb
arel-2.1.3 test/nodes/test_select_core.rb
arel-2.1.2 test/nodes/test_select_core.rb
arel-2.1.1 test/nodes/test_select_core.rb
arel-2.1.0 test/nodes/test_select_core.rb