From c510f059673edf9477c90c3c9c083caa6689101d Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 19 Aug 2010 02:07:46 +0200 Subject: get rid of the warning "+ after local variable is interpreted as binary operator even though it seems like unary operator" in Ruby 1.9.2 --- .../test/cases/autosave_association_test.rb | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index 4693cb45fc..52382f5afc 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -249,8 +249,8 @@ class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::Test assert_equal customer1, order.billing assert_equal customer2, order.shipping - assert_equal num_orders +1, Order.count - assert_equal num_customers +2, Customer.count + assert_equal num_orders + 1, Order.count + assert_equal num_customers + 2, Customer.count end def test_store_association_in_two_relations_with_one_save @@ -268,8 +268,8 @@ class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::Test assert_equal customer, order.billing assert_equal customer, order.shipping - assert_equal num_orders +1, Order.count - assert_equal num_customers +1, Customer.count + assert_equal num_orders + 1, Order.count + assert_equal num_customers + 1, Customer.count end def test_store_association_in_two_relations_with_one_save_in_existing_object @@ -287,8 +287,8 @@ class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::Test assert_equal customer, order.billing assert_equal customer, order.shipping - assert_equal num_orders +1, Order.count - assert_equal num_customers +1, Customer.count + assert_equal num_orders + 1, Order.count + assert_equal num_customers + 1, Customer.count end def test_store_association_in_two_relations_with_one_save_in_existing_object_with_values @@ -311,14 +311,14 @@ class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::Test assert_equal customer, order.billing assert_equal customer, order.shipping - assert_equal num_orders +1, Order.count - assert_equal num_customers +2, Customer.count + assert_equal num_orders + 1, Order.count + assert_equal num_customers + 2, Customer.count end def test_store_association_with_a_polymorphic_relationship num_tagging = Tagging.count tags(:misc).create_tagging(:taggable => posts(:thinking)) - assert_equal num_tagging +1, Tagging.count + assert_equal num_tagging + 1, Tagging.count end end @@ -372,7 +372,7 @@ class TestDefaultAutosaveAssociationOnAHasManyAssociation < ActiveRecord::TestCa assert firm.save assert !client.new_record? - assert_equal no_of_clients+1, Client.count + assert_equal no_of_clients + 1, Client.count end def test_invalid_build @@ -403,8 +403,8 @@ class TestDefaultAutosaveAssociationOnAHasManyAssociation < ActiveRecord::TestCa assert !new_firm.new_record? assert !c.new_record? assert_equal new_firm, c.firm - assert_equal no_of_firms+1, Firm.count # Firm was saved to database. - assert_equal no_of_clients+2, Client.count # Clients were saved to database. + assert_equal no_of_firms + 1, Firm.count # Firm was saved to database. + assert_equal no_of_clients + 2, Client.count # Clients were saved to database. assert_equal 2, new_firm.clients_of_firm.size assert_equal 2, new_firm.clients_of_firm(true).size @@ -1061,7 +1061,7 @@ module AutosaveAssociationOnACollectionAssociationTests end def test_should_allow_to_bypass_validations_on_the_associated_models_on_create - assert_difference("#{ @association_name == :birds ? 'Bird' : 'Parrot' }.count", +2) do + assert_difference("#{ @association_name == :birds ? 'Bird' : 'Parrot' }.count", 2) do 2.times { @pirate.send(@association_name).build } @pirate.save(:validate => false) end -- cgit v1.2.3