aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes/test_select_core.rb
blob: 0aacf41720d6b8f619f16643264dc8df3b59e368 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe Arel::Nodes::SelectCore do
  describe "#clone" do
    it "clones froms, projections and wheres" do
      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
  end
end