From 4e1dd7eeabde2bd785d47db895e45c11f1693c05 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 30 Aug 2010 18:35:13 -0400 Subject: deep copies of statements aren't necessary. shallow copy the top-level arrays. --- spec/arel/nodes/insert_statement_spec.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'spec/arel/nodes/insert_statement_spec.rb') diff --git a/spec/arel/nodes/insert_statement_spec.rb b/spec/arel/nodes/insert_statement_spec.rb index 286a44130c..0e2432c021 100644 --- a/spec/arel/nodes/insert_statement_spec.rb +++ b/spec/arel/nodes/insert_statement_spec.rb @@ -7,16 +7,12 @@ describe Arel::Nodes::InsertStatement do 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 + statement.columns.should_receive(:clone).and_return([:columns]) + statement.values.should_receive(:clone).and_return([:values]) dolly = statement.clone - check dolly.columns.should == %w[a0 b1 c2] - check dolly.values.should == %w[x0 y1 z2] + check dolly.columns.should == [:columns] + check dolly.values.should == [:values] end end end -- cgit v1.2.3