From 09d1093a566bc9f1aa5423290541b5f324ecb0b8 Mon Sep 17 00:00:00 2001 From: Will Dean Date: Thu, 20 Feb 2025 11:37:20 +0100 Subject: [PATCH] add some tests --- lua/tests/plenary/gh_spec.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lua/tests/plenary/gh_spec.lua b/lua/tests/plenary/gh_spec.lua index 064afba8..ee85f805 100644 --- a/lua/tests/plenary/gh_spec.lua +++ b/lua/tests/plenary/gh_spec.lua @@ -14,6 +14,41 @@ describe("insert_args:", function() } eq(args, expected) end) + it("Replace mapping default", function() + local args = {} + local opts = { + remove_label = "Some label", + } + gh.insert_args(args, opts) + local expected = { + "--remove_label", + "Some label", + } + eq(args, expected) + end) + it("Replace mapping underscores", function() + local args = {} + local opts = { + remove_label = "Some label", + } + gh.insert_args(args, opts, { ["_"] = "-" }) + local expected = { + "--remove-label", + "Some label", + } + eq(args, expected) + end) + it("Replace mapping underscores boolean", function() + local args = {} + local opts = { + remove_milestone = true, + } + gh.insert_args(args, opts, { ["_"] = "-" }) + local expected = { + "--remove-milestone", + } + eq(args, expected) + end) it("single characters have single hyphen", function() local args = {} local opts = {