@@ -46,6 +46,7 @@ def test_setup
4646 assert_equal ( "http" , ShopifyAPI ::Context . host_scheme )
4747 assert_equal ( "localhost" , ShopifyAPI ::Context . host_name )
4848 assert_equal ( "example.com" , ShopifyAPI ::Context . api_host )
49+ assert_equal ( { } , ShopifyAPI ::Context . httparty_params )
4950
5051 ShopifyAPI ::Context . setup (
5152 api_key : "key" ,
@@ -146,6 +147,49 @@ def test_with_host_name_and_no_host_env
146147 ENV [ "HOST" ] = old_host
147148 end
148149
150+ def test_with_httparty_params
151+ clear_context
152+
153+ ShopifyAPI ::Context . setup (
154+ api_key : "key" ,
155+ api_secret_key : "secret" ,
156+ api_version : "2023-10" ,
157+ scope : [ "scope1" , "scope2" ] ,
158+ is_private : true ,
159+ is_embedded : true ,
160+ log_level : :off ,
161+ private_shop : "privateshop.myshopify.com" ,
162+ user_agent_prefix : "user_agent_prefix1" ,
163+ old_api_secret_key : "old_secret" ,
164+ api_host : "example.com" ,
165+ httparty_params : {
166+ timeout : 10 ,
167+ open_timeout : 20 ,
168+ read_timeout : 30 ,
169+ write_timeout : 40 ,
170+ debug_output : true ,
171+ http_proxyaddr : "my.proxy.server" ,
172+ http_proxyport : 8000 ,
173+ http_proxyuser : "user" ,
174+ http_proxypass : "pass" ,
175+ } ,
176+ )
177+ assert_equal (
178+ {
179+ timeout : 10 ,
180+ open_timeout : 20 ,
181+ read_timeout : 30 ,
182+ write_timeout : 40 ,
183+ debug_output : true ,
184+ http_proxyaddr : "my.proxy.server" ,
185+ http_proxyport : 8000 ,
186+ http_proxyuser : "user" ,
187+ http_proxypass : "pass" ,
188+ } ,
189+ ShopifyAPI ::Context . httparty_params ,
190+ )
191+ end
192+
149193 def test_send_a_warning_if_log_level_is_invalid
150194 ShopifyAPI ::Context . stubs ( :log_level ) . returns ( :warn )
151195 ShopifyAPI ::Logger . expects ( :warn ) . with ( "not_a_level is not a valid log_level. " \
0 commit comments