From 068b184a59a98b4acdc63a2833c360199d138c1d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 29 Jul 2010 12:01:08 -0700 Subject: PERF: removing many splats --- spec/engines/sql/unit/relations/group_spec.rb | 4 ++-- spec/engines/sql/unit/relations/order_spec.rb | 10 +++++----- spec/engines/sql/unit/relations/project_spec.rb | 8 ++++---- spec/engines/sql/unit/relations/where_spec.rb | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'spec/engines') diff --git a/spec/engines/sql/unit/relations/group_spec.rb b/spec/engines/sql/unit/relations/group_spec.rb index 72a9f4e99e..c32091bf08 100644 --- a/spec/engines/sql/unit/relations/group_spec.rb +++ b/spec/engines/sql/unit/relations/group_spec.rb @@ -10,7 +10,7 @@ module Arel describe '#to_sql' do describe 'when given a predicate' do it "manufactures sql with where clause conditions" do - sql = Group.new(@relation, @attribute).to_sql + sql = Group.new(@relation, [@attribute]).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -40,7 +40,7 @@ module Arel describe 'when given a string' do it "passes the string through to the where clause" do - sql = Group.new(@relation, 'asdf').to_sql + sql = Group.new(@relation, ['asdf']).to_sql adapter_is :mysql do sql.should be_like(%Q{ diff --git a/spec/engines/sql/unit/relations/order_spec.rb b/spec/engines/sql/unit/relations/order_spec.rb index 3c9d9ef598..59637876bf 100644 --- a/spec/engines/sql/unit/relations/order_spec.rb +++ b/spec/engines/sql/unit/relations/order_spec.rb @@ -10,7 +10,7 @@ module Arel describe '#to_sql' do describe "when given an attribute" do it "manufactures sql with an order clause populated by the attribute" do - sql = Order.new(@relation, @attribute).to_sql + sql = Order.new(@relation, [@attribute]).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -60,7 +60,7 @@ module Arel end it "manufactures sql with an order clause populated by comma-separated attributes" do - sql = Order.new(@relation, @attribute, @another_attribute).to_sql + sql = Order.new(@relation, [@attribute, @another_attribute]).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -94,7 +94,7 @@ module Arel end it "passes the string through to the order clause" do - sql = Order.new(@relation, @string).to_sql + sql = Order.new(@relation, [@string]).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -124,12 +124,12 @@ module Arel describe "when ordering an ordered relation" do before do - @ordered_relation = Order.new(@relation, @attribute) + @ordered_relation = Order.new(@relation, [@attribute]) @another_attribute = @relation[:name] end it "manufactures sql with the order clause of the last ordering preceding the first ordering" do - sql = Order.new(@ordered_relation, @another_attribute).to_sql + sql = Order.new(@ordered_relation, [@another_attribute]).to_sql adapter_is :mysql do sql.should be_like(%Q{ diff --git a/spec/engines/sql/unit/relations/project_spec.rb b/spec/engines/sql/unit/relations/project_spec.rb index e73c7775a1..b5d2d33d4b 100644 --- a/spec/engines/sql/unit/relations/project_spec.rb +++ b/spec/engines/sql/unit/relations/project_spec.rb @@ -10,7 +10,7 @@ module Arel describe '#to_sql' do describe 'when given an attribute' do it "manufactures sql with a limited select clause" do - sql = Project.new(@relation, @attribute).to_sql + sql = Project.new(@relation, [@attribute]).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -37,11 +37,11 @@ module Arel describe 'when given a relation' do before do - @scalar_relation = Project.new(@relation, @relation[:name]) + @scalar_relation = Project.new(@relation, [@relation[:name]]) end it "manufactures sql with scalar selects" do - sql = Project.new(@relation, @scalar_relation).to_sql + sql = Project.new(@relation, [@scalar_relation]).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -65,7 +65,7 @@ module Arel describe 'when given a string' do it "passes the string through to the select clause" do - sql = Project.new(@relation, 'asdf').to_sql + sql = Project.new(@relation, ['asdf']).to_sql adapter_is :mysql do sql.should be_like(%Q{ diff --git a/spec/engines/sql/unit/relations/where_spec.rb b/spec/engines/sql/unit/relations/where_spec.rb index 5f559efad3..69793d63a1 100644 --- a/spec/engines/sql/unit/relations/where_spec.rb +++ b/spec/engines/sql/unit/relations/where_spec.rb @@ -10,7 +10,7 @@ module Arel describe '#to_sql' do describe 'when given a predicate' do it "manufactures sql with where clause conditions" do - sql = Where.new(@relation, @predicate).to_sql + sql = Where.new(@relation, [@predicate]).to_sql adapter_is :mysql do sql.should be_like(%Q{ -- cgit v1.2.3