Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/plenary/curl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ end
-- Main ----------------------------------------------------
------------------------------------------------------------
return (function()
local spec = {}
local partial = function(method)
return function(url, opts)
local spec = {}
opts = opts or {}
if type(url) == "table" then
opts = url
Expand Down
18 changes: 17 additions & 1 deletion tests/plenary/curl_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,26 @@ describe("CURL Wrapper:", function()
end)
end)

describe("DEPUG", function() --------------------------------------------------
describe("DEBUG", function() --------------------------------------------------
it("dry_run return the curl command to be ran.", function()
local res = curl.delete("https://jsonplaceholder.typicode.com/posts/8", { dry_run = true })
assert(type(res) == "table")
end)
end)

describe("Issue #601", function() --------------------------------------------
it("should not use URL from previous call", function()
local url = "https://example.com"
local opts = { dry_run = true, dump = "" } -- dump would be random each time
local first = curl.get(url, opts)
eq(table.remove(first, #first), url, "expected url last")

local success, second = pcall(curl.get, opts)
if success then
eq(first, second, "should be same, but without url")
else
-- Failure is also acceptable
end
end)
end)
end)
Loading