Skip to content

Commit

Permalink
changes assertion of instance to kind
Browse files Browse the repository at this point in the history
this change makes it easier to test on both activesupport versions since
the HashWithIndifferentAccess inherits from Hash in both cases
  • Loading branch information
Jens Fahnenbruck committed May 18, 2011
1 parent a0e49b4 commit 714e852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/connection/test_get_module_fields.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class TestModuleFields < ActiveSupport::TestCase
context "A SugarCRM.connection" do context "A SugarCRM.connection" do
should "return a hash of module fields when #get_module_fields" do should "return a hash of module fields when #get_module_fields" do
fields = SugarCRM.connection.get_module_fields("Users") fields = SugarCRM.connection.get_module_fields("Users")
assert_instance_of ActiveSupport::HashWithIndifferentAccess, fields assert_kind_of Hash, fields
assert "address_city", fields.keys[0] assert "address_city", fields.keys[0]
end end
end end
end end
6 changes: 3 additions & 3 deletions test/test_sugarcrm.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TestSugarCRM < ActiveSupport::TestCase


should "implement self.count" do should "implement self.count" do
nb_accounts = SugarCRM::Account.count nb_accounts = SugarCRM::Account.count
assert nb_accounts > 0 assert nb_accounts > 0, "There should be some Accounts"
nb_inc_accounts = nil nb_inc_accounts = nil
assert_nothing_raised do assert_nothing_raised do
nb_inc_accounts = SugarCRM::Account.count(:conditions => {:name => "LIKE '%Inc'"}) nb_inc_accounts = SugarCRM::Account.count(:conditions => {:name => "LIKE '%Inc'"})
Expand All @@ -38,7 +38,7 @@ class TestSugarCRM < ActiveSupport::TestCase
end end


should "return the module fields" do should "return the module fields" do
assert_instance_of ActiveSupport::HashWithIndifferentAccess, SugarCRM::Account._module.fields assert_kind_of Hash, SugarCRM::Account._module.fields
end end


should "respond to self#methods" do should "respond to self#methods" do
Expand All @@ -59,7 +59,7 @@ class TestSugarCRM < ActiveSupport::TestCase
end end


should "respond to self.attributes_from_modules_fields" do 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 end


should "return an instance of itself when #new" do should "return an instance of itself when #new" do
Expand Down

0 comments on commit 714e852

Please sign in to comment.