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 332332-- Main ----------------------------------------------------
333333---- --------------------------------------------------------
334334return (function ()
335- local spec = {}
336335 local partial = function (method )
337336 return function (url , opts )
337+ local spec = {}
338338 opts = opts or {}
339339 if type (url ) == " table" then
340340 opts = url
Original file line number Diff line number Diff line change @@ -196,10 +196,26 @@ describe("CURL Wrapper:", function()
196196 end )
197197 end )
198198
199- describe (" DEPUG " , function () ---- ----------------------------------------------
199+ describe (" DEBUG " , function () ---- ----------------------------------------------
200200 it (" dry_run return the curl command to be ran." , function ()
201201 local res = curl .delete (" https://jsonplaceholder.typicode.com/posts/8" , { dry_run = true })
202202 assert (type (res ) == " table" )
203203 end )
204204 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 )
205221end )
You can’t perform that action at this time.
0 commit comments