Permalink
Browse files

User assert_kind_of, invert assert_equal expectations

  • Loading branch information...
1 parent 544b5ee commit 7ad590d25f9a4b1040cf663b8387626d03ffcf87 @carlosantoniodasilva carlosantoniodasilva committed Nov 29, 2012
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit 7ad590d

Please sign in to comment.