Permalink
Browse files

changes assertion of instance to kind

this change makes it easier to test on both activesupport versions since
the HashWithIndifferentAccess inherits from Hash in both cases
  • Loading branch information...
1 parent a0e49b4 commit 714e852b866590b021c964394f6ce73f8f134945 Jens Fahnenbruck committed May 18, 2011
Showing with 5 additions and 5 deletions.
  1. +2 −2 test/connection/test_get_module_fields.rb
  2. +3 −3 test/test_sugarcrm.rb
@@ -4,8 +4,8 @@ class TestModuleFields < ActiveSupport::TestCase
context "A SugarCRM.connection" do
should "return a hash of module fields when #get_module_fields" do
fields = SugarCRM.connection.get_module_fields("Users")
- assert_instance_of ActiveSupport::HashWithIndifferentAccess, fields
+ assert_kind_of Hash, fields
assert "address_city", fields.keys[0]
end
end
-end
+end
View
@@ -13,7 +13,7 @@ class TestSugarCRM < ActiveSupport::TestCase
should "implement self.count" do
nb_accounts = SugarCRM::Account.count
- assert nb_accounts > 0
+ assert nb_accounts > 0, "There should be some Accounts"
nb_inc_accounts = nil
assert_nothing_raised do
nb_inc_accounts = SugarCRM::Account.count(:conditions => {:name => "LIKE '%Inc'"})
@@ -38,7 +38,7 @@ class TestSugarCRM < ActiveSupport::TestCase
end
should "return the module fields" do
- assert_instance_of ActiveSupport::HashWithIndifferentAccess, SugarCRM::Account._module.fields
+ assert_kind_of Hash, SugarCRM::Account._module.fields
end
should "respond to self#methods" do
@@ -59,7 +59,7 @@ class TestSugarCRM < ActiveSupport::TestCase
end
should "respond to self.attributes_from_modules_fields" do
- assert_instance_of ActiveSupport::HashWithIndifferentAccess, SugarCRM::User.attributes_from_module
+ assert_kind_of Hash, SugarCRM::User.attributes_from_module
end
should "return an instance of itself when #new" do

0 comments on commit 714e852

Please sign in to comment.