diff options
author | Mike Dalessio <mike@csa.net> | 2010-08-30 18:35:13 -0400 |
---|---|---|
committer | Mike Dalessio <mike@csa.net> | 2010-08-30 18:35:13 -0400 |
commit | 4e1dd7eeabde2bd785d47db895e45c11f1693c05 (patch) | |
tree | 4fe7931adea5681a15ac5feee3c504cce1ca021a /spec/arel/nodes/select_core_spec.rb | |
parent | dc750bef5cf5b577399c84f97b821af26c9554a2 (diff) | |
download | rails-4e1dd7eeabde2bd785d47db895e45c11f1693c05.tar.gz rails-4e1dd7eeabde2bd785d47db895e45c11f1693c05.tar.bz2 rails-4e1dd7eeabde2bd785d47db895e45c11f1693c05.zip |
deep copies of statements aren't necessary. shallow copy the top-level arrays.
Diffstat (limited to 'spec/arel/nodes/select_core_spec.rb')
-rw-r--r-- | spec/arel/nodes/select_core_spec.rb | 10 |
1 files changed, 4 insertions, 6 deletions
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 |