1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/spec/arel/nodes/insert_statement_spec.rb

23 lines
627 B
Ruby
Raw Normal View History

2010-08-16 23:59:18 -04:00
require 'spec_helper'
describe Arel::Nodes::InsertStatement do
2010-08-19 01:30:21 -04:00
describe "#clone" do
it "clones columns and values" do
2010-08-16 23:59:18 -04:00
statement = Arel::Nodes::InsertStatement.new
statement.columns = %w[a b c]
statement.values = %w[x y z]
statement.columns.each_with_index do |o, j|
o.should_receive(:clone).and_return("#{o}#{j}")
end
statement.values.each_with_index do |o, j|
o.should_receive(:clone).and_return("#{o}#{j}")
end
dolly = statement.clone
2010-08-22 21:13:39 -04:00
check dolly.columns.should == %w[a0 b1 c2]
check dolly.values.should == %w[x0 y1 z2]
2010-08-16 23:59:18 -04:00
end
end
end