Browse Source

Fix tests

Simon Mathieu 6 years ago
parent
commit
50dd2ad9fc
1 changed files with 7 additions and 5 deletions
  1. 7 5
      test/test_helper.rb

+ 7 - 5
test/test_helper.rb

@@ -30,11 +30,13 @@ class Test::Unit::TestCase < Minitest::Unit::TestCase
 
   def setup
     ActiveResource::Base.format = :json
-    ShopifyAPI.constants.each do |const|
-      begin
-        const = "ShopifyAPI::#{const}".constantize
-        const.format = :json if const.respond_to?(:format=)
-      rescue NameError
+    [ShopifyAPI, ShopifyAPI::Ping].each do |mod|
+      mod.constants.each do |const|
+        begin
+          const = mod.const_get(const)
+          const.format = :json if const.respond_to?(:format=)
+        rescue NameError
+        end
       end
     end