Skip to content

Commit

Permalink
refactor: rename the user command
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Oct 25, 2023
1 parent 1bcfdb0 commit 20fdbb7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add the following configuration to your Neovim setup:
"jellydn/hurl.nvim",
ft = "hurl",
dependencies = { "MunifTanjim/nui.nvim" },
cmd = { "HurlRun" },
cmd = { "HurlRunner" },
opts = {
-- Show debugging info
debug = false,
Expand All @@ -27,9 +27,9 @@ Add the following configuration to your Neovim setup:
},
keys = {
-- Run API request
{ "<leader>ra", "<cmd>HurlRun<CR>", desc = "Run API requests" },
{ "<leader>ra", "<cmd>HurlRunner<CR>", desc = "Run API requests" },
-- Run API request in visual mode
{ "<leader>cr", ":HurlRun<CR>", desc = "Run API request", mode = "v" },
{ "<leader>cr", ":HurlRunner<CR>", desc = "Run API request", mode = "v" },
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion lua/hurl/wrapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ local function run_selection(opts)
end

function M.setup()
util.create_cmd('HurlRun', function(opts)
util.create_cmd('HurlRunner', function(opts)
if opts.range ~= 0 then
run_selection(opts.fargs)
else
Expand Down
12 changes: 12 additions & 0 deletions test/hurl_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local hurl = require('hurl.wrapper')

describe('Hurl wrapper', function()
it('should be able to load', function()
assert.truthy(hurl)
end)

it('should define a custom command: HurlRunner', function()
-- TODO: add a test to check if the command is defined
assert.falsy(true)
end)
end)

0 comments on commit 20fdbb7

Please sign in to comment.