aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/nodes/insert_statement_spec.rb
blob: 0e2432c021d2b4f849dbc2dbcd03e02d6fb6d6df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'spec_helper'

describe Arel::Nodes::InsertStatement do
  describe "#clone" do
    it "clones columns and values" do
      statement = Arel::Nodes::InsertStatement.new
      statement.columns = %w[a b c]
      statement.values  = %w[x y z]

      statement.columns.should_receive(:clone).and_return([:columns])
      statement.values.should_receive(:clone).and_return([:values])

      dolly = statement.clone
      check dolly.columns.should == [:columns]
      check dolly.values.should  == [:values]
    end
  end
end