File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 332
332
-- Main ----------------------------------------------------
333
333
---- --------------------------------------------------------
334
334
return (function ()
335
- local spec = {}
336
335
local partial = function (method )
337
336
return function (url , opts )
337
+ local spec = {}
338
338
opts = opts or {}
339
339
if type (url ) == " table" then
340
340
opts = url
Original file line number Diff line number Diff line change @@ -196,10 +196,26 @@ describe("CURL Wrapper:", function()
196
196
end )
197
197
end )
198
198
199
- describe (" DEPUG " , function () ---- ----------------------------------------------
199
+ describe (" DEBUG " , function () ---- ----------------------------------------------
200
200
it (" dry_run return the curl command to be ran." , function ()
201
201
local res = curl .delete (" https://jsonplaceholder.typicode.com/posts/8" , { dry_run = true })
202
202
assert (type (res ) == " table" )
203
203
end )
204
204
end )
205
+
206
+ describe (" Issue #601" , function () ---- ----------------------------------------
207
+ it (" should not use URL from previous call" , function ()
208
+ local url = " https://example.com"
209
+ local opts = { dry_run = true , dump = " " } -- dump would be random each time
210
+ local first = curl .get (url , opts )
211
+ eq (table.remove (first , # first ), url , " expected url last" )
212
+
213
+ local success , second = pcall (curl .get , opts )
214
+ if success then
215
+ eq (first , second , " should be same, but without url" )
216
+ else
217
+ -- Failure is also acceptable
218
+ end
219
+ end )
220
+ end )
205
221
end )
You can’t perform that action at this time.
0 commit comments