Permalink
Browse files

get rid of the warning "+ after local variable is interpreted as bina…

…ry operator even though it seems like unary operator" in Ruby 1.9.2
  • Loading branch information...
1 parent 0663257 commit ddce48a35582b27edeb6d1f18d6466938af9e9b7 @fxn fxn committed Aug 19, 2010
Showing with 13 additions and 13 deletions.
  1. +13 −13 activerecord/test/cases/autosave_association_test.rb
@@ -249,8 +249,8 @@ def test_store_two_association_with_one_save
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 @@ def test_store_association_in_two_relations_with_one_save
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 @@ def test_store_association_in_two_relations_with_one_save_in_existing_object
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 @@ def test_store_association_in_two_relations_with_one_save_in_existing_object_wit
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 @@ def test_valid_adding_with_validate_false
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 @@ def test_adding_before_save
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 @@ def test_should_validation_the_associated_models_on_create
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

0 comments on commit ddce48a

Please sign in to comment.