@@ -45,7 +45,7 @@ def test_client_default_request_default_retry_attempts
4545 )
4646
4747 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
48- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
48+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
4949 end
5050
5151 assert_requested ( :any , /./ , times : 3 )
@@ -63,7 +63,7 @@ def test_client_given_request_default_retry_attempts
6363 )
6464
6565 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
66- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
66+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
6767 end
6868
6969 assert_requested ( :any , /./ , times : 4 )
@@ -81,7 +81,7 @@ def test_client_default_request_given_retry_attempts
8181
8282 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
8383 image_kit . files . upload (
84- file : Pathname ( __FILE__ ) ,
84+ file : "https://www.example.com/path/to-image.jpg" ,
8585 file_name : "fileName" ,
8686 request_options : { max_retries : 3 }
8787 )
@@ -103,7 +103,7 @@ def test_client_given_request_given_retry_attempts
103103
104104 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
105105 image_kit . files . upload (
106- file : Pathname ( __FILE__ ) ,
106+ file : "https://www.example.com/path/to-image.jpg" ,
107107 file_name : "fileName" ,
108108 request_options : { max_retries : 4 }
109109 )
@@ -128,7 +128,7 @@ def test_client_retry_after_seconds
128128 )
129129
130130 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
131- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
131+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
132132 end
133133
134134 assert_requested ( :any , /./ , times : 2 )
@@ -152,7 +152,7 @@ def test_client_retry_after_date
152152
153153 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
154154 Thread . current . thread_variable_set ( :time_now , Time . now )
155- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
155+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
156156 Thread . current . thread_variable_set ( :time_now , nil )
157157 end
158158
@@ -176,7 +176,7 @@ def test_client_retry_after_ms
176176 )
177177
178178 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
179- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
179+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
180180 end
181181
182182 assert_requested ( :any , /./ , times : 2 )
@@ -194,7 +194,7 @@ def test_retry_count_header
194194 )
195195
196196 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
197- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
197+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
198198 end
199199
200200 3 . times do
@@ -214,7 +214,7 @@ def test_omit_retry_count_header
214214
215215 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
216216 image_kit . files . upload (
217- file : Pathname ( __FILE__ ) ,
217+ file : "https://www.example.com/path/to-image.jpg" ,
218218 file_name : "fileName" ,
219219 request_options : { extra_headers : { "x-stainless-retry-count" => nil } }
220220 )
@@ -237,7 +237,7 @@ def test_overwrite_retry_count_header
237237
238238 assert_raises ( Imagekit ::Errors ::InternalServerError ) do
239239 image_kit . files . upload (
240- file : Pathname ( __FILE__ ) ,
240+ file : "https://www.example.com/path/to-image.jpg" ,
241241 file_name : "fileName" ,
242242 request_options : { extra_headers : { "x-stainless-retry-count" => "42" } }
243243 )
@@ -266,7 +266,7 @@ def test_client_redirect_307
266266
267267 assert_raises ( Imagekit ::Errors ::APIConnectionError ) do
268268 image_kit . files . upload (
269- file : Pathname ( __FILE__ ) ,
269+ file : "https://www.example.com/path/to-image.jpg" ,
270270 file_name : "fileName" ,
271271 request_options : { extra_headers : { } }
272272 )
@@ -304,7 +304,7 @@ def test_client_redirect_303
304304
305305 assert_raises ( Imagekit ::Errors ::APIConnectionError ) do
306306 image_kit . files . upload (
307- file : Pathname ( __FILE__ ) ,
307+ file : "https://www.example.com/path/to-image.jpg" ,
308308 file_name : "fileName" ,
309309 request_options : { extra_headers : { } }
310310 )
@@ -337,7 +337,7 @@ def test_client_redirect_auth_keep_same_origin
337337
338338 assert_raises ( Imagekit ::Errors ::APIConnectionError ) do
339339 image_kit . files . upload (
340- file : Pathname ( __FILE__ ) ,
340+ file : "https://www.example.com/path/to-image.jpg" ,
341341 file_name : "fileName" ,
342342 request_options : { extra_headers : { "authorization" => "Bearer xyz" } }
343343 )
@@ -373,7 +373,7 @@ def test_client_redirect_auth_strip_cross_origin
373373
374374 assert_raises ( Imagekit ::Errors ::APIConnectionError ) do
375375 image_kit . files . upload (
376- file : Pathname ( __FILE__ ) ,
376+ file : "https://www.example.com/path/to-image.jpg" ,
377377 file_name : "fileName" ,
378378 request_options : { extra_headers : { "authorization" => "Bearer xyz" } }
379379 )
@@ -395,7 +395,7 @@ def test_default_headers
395395 password : "My Password"
396396 )
397397
398- image_kit . files . upload ( file : Pathname ( __FILE__ ) , file_name : "fileName" )
398+ image_kit . files . upload ( file : "https://www.example.com/path/to-image.jpg" , file_name : "fileName" )
399399
400400 assert_requested ( :any , /./ ) do |req |
401401 headers = req . headers . transform_keys ( &:downcase ) . fetch_values ( "accept" , "content-type" )
0 commit comments