Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

User assert_kind_of, invert assert_equal expectations

  • Loading branch information...
commit 7ad590d25f9a4b1040cf663b8387626d03ffcf87 1 parent 544b5ee
Carlos Antonio da Silva carlosantoniodasilva authored
6 activerecord/test/cases/associations/belongs_to_associations_test.rb
View
@@ -112,19 +112,19 @@ def test_building_the_belonging_object
def test_building_the_belonging_object_with_implicit_sti_base_class
account = Account.new
company = account.build_firm
- assert(company.kind_of?(Company), "Expected #{company.class} to be a Company")
+ assert_kind_of Company, company, "Expected #{company.class} to be a Company"
end
def test_building_the_belonging_object_with_explicit_sti_base_class
account = Account.new
company = account.build_firm(:type => "Company")
- assert(company.kind_of?(Company), "Expected #{company.class} to be a Company")
+ assert_kind_of Company, company, "Expected #{company.class} to be a Company"
end
def test_building_the_belonging_object_with_sti_subclass
account = Account.new
company = account.build_firm(:type => "Firm")
- assert(company.kind_of?(Firm), "Expected #{company.class} to be a Firm")
+ assert_kind_of Firm, company, "Expected #{company.class} to be a Firm"
end
def test_building_the_belonging_object_with_an_invalid_type
6 activerecord/test/cases/associations/has_many_associations_test.rb
View
@@ -147,19 +147,19 @@ def test_create_from_association_with_nil_values_should_work
def test_building_the_associated_object_with_implicit_sti_base_class
firm = DependentFirm.new
company = firm.companies.build
- assert(company.kind_of?(Company), "Expected #{company.class} to be a Company")
+ assert_kind_of Company, company, "Expected #{company.class} to be a Company"
end
def test_building_the_associated_object_with_explicit_sti_base_class
firm = DependentFirm.new
company = firm.companies.build(:type => "Company")
- assert(company.kind_of?(Company), "Expected #{company.class} to be a Company")
+ assert_kind_of Company, company, "Expected #{company.class} to be a Company"
end
def test_building_the_associated_object_with_sti_subclass
firm = DependentFirm.new
company = firm.companies.build(:type => "Client")
- assert(company.kind_of?(Client), "Expected #{company.class} to be a Client")
+ assert_kind_of Client, company, "Expected #{company.class} to be a Client"
end
def test_building_the_associated_object_with_an_invalid_type
6 activerecord/test/cases/associations/has_one_associations_test.rb
View
@@ -217,19 +217,19 @@ def test_build_association_dont_create_transaction
def test_building_the_associated_object_with_implicit_sti_base_class
firm = DependentFirm.new
company = firm.build_company
- assert(company.kind_of?(Company), "Expected #{company.class} to be a Company")
+ assert_kind_of Company, company, "Expected #{company.class} to be a Company"
end
def test_building_the_associated_object_with_explicit_sti_base_class
firm = DependentFirm.new
company = firm.build_company(:type => "Company")
- assert(company.kind_of?(Company), "Expected #{company.class} to be a Company")
+ assert_kind_of Company, company, "Expected #{company.class} to be a Company"
end
def test_building_the_associated_object_with_sti_subclass
firm = DependentFirm.new
company = firm.build_company(:type => "Client")
- assert(company.kind_of?(Client), "Expected #{company.class} to be a Client")
+ assert_kind_of Client, company, "Expected #{company.class} to be a Client"
end
def test_building_the_associated_object_with_an_invalid_type
6 activerecord/test/cases/inheritance_test.rb
View
@@ -158,17 +158,17 @@ def test_alt_inheritance_save
def test_inheritance_new_with_default_class
company = Company.new
- assert_equal company.class, Company
+ assert_equal Company, company.class
end
def test_inheritance_new_with_base_class
company = Company.new(:type => 'Company')
- assert_equal company.class, Company
+ assert_equal Company, company.class
end
def test_inheritance_new_with_subclass
firm = Company.new(:type => 'Firm')
- assert_equal firm.class, Firm
+ assert_equal Firm, firm.class
end
def test_new_with_invalid_type
Please sign in to comment.
Something went wrong with that request. Please try again.