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/select_core_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'spec/arel/nodes/select_core_spec.rb') diff --git a/spec/arel/nodes/select_core_spec.rb b/spec/arel/nodes/select_core_spec.rb index 30927abea6..d2e87c2c23 100644 --- a/spec/arel/nodes/select_core_spec.rb +++ b/spec/arel/nodes/select_core_spec.rb @@ -9,15 +9,13 @@ describe Arel::Nodes::SelectCore do core.instance_variable_set "@wheres", %w[g h i] [:froms, :projections, :wheres].each do |array_attr| - core.send(array_attr).each_with_index do |o, j| - o.should_receive(:clone).and_return("#{o}#{j}") - end + core.send(array_attr).should_receive(:clone).and_return([array_attr]) end dolly = core.clone - check dolly.froms.should == %w[a0 b1 c2] - check dolly.projections.should == %w[d0 e1 f2] - check dolly.wheres.should == %w[g0 h1 i2] + check dolly.froms.should == [:froms] + check dolly.projections.should == [:projections] + check dolly.wheres.should == [:wheres] end end end -- cgit v1.2.3