From 6b65c5085fdc06006c729647936b28f7115a808b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 21 Jan 2022 17:15:32 +0100 Subject: [PATCH] Fix small test errors --- lua/test/action_spec.lua | 2 +- lua/test/files_spec.lua | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/test/action_spec.lua b/lua/test/action_spec.lua index 240f27d..0eb32a2 100644 --- a/lua/test/action_spec.lua +++ b/lua/test/action_spec.lua @@ -107,7 +107,7 @@ end) describe("create_link", function() it("substitutes the argument text with a link", function() - pending() + pending("not implemented") vim.fn = {getpos = function() return {1, 2, 3} end} vim.api = { nvim_buf_get_lines = function() return {"hi", 1, 2} end, diff --git a/lua/test/files_spec.lua b/lua/test/files_spec.lua index 0e23b7d..c5874a6 100644 --- a/lua/test/files_spec.lua +++ b/lua/test/files_spec.lua @@ -19,7 +19,7 @@ local function simple_api_mock(files) end describe("get_anchors_and_paths", function() - before_each(function() get_api_mock = simple_api_mock end) + before_each(function() Get_api_mock = simple_api_mock end) after_each(function() _G.vim = nil end) it("should return anchor-keyed table pointing to filename of zettel", @@ -27,7 +27,7 @@ describe("get_anchors_and_paths", function() local file_list = {} file_list["someDir/1910291645 this-is-a-testfile.md"] = "1910291645 this-is-a-testfile.md" - _G.vim = get_api_mock(file_list) + _G.vim = Get_api_mock(file_list) local expected = { ["1910291645"] = "someDir/1910291645 this-is-a-testfile.md" @@ -43,7 +43,7 @@ describe("get_anchors_and_paths", function() ["1910271456 this-is-wrong-extension.txt"] = "1910271456 this-is-wrong-extension.txt", ["1812 this-is-ignored.md"] = "1812 this-is-ignored.md" } - _G.vim = get_api_mock(file_list) + _G.vim = Get_api_mock(file_list) local expected = { ["1910291645"] = "someDir/1910291645 this-is-a-testfile.md", @@ -57,7 +57,7 @@ describe("get_anchors_and_paths", function() ["mydirectory/1910291645 myfile.wiki"] = "1910291645 myfile.wiki", ["mydirectory/2345678901 another.wiki"] = "2345678901 another.wiki" } - _G.vim = get_api_mock(file_list) + _G.vim = Get_api_mock(file_list) vim.g['zettel_extension'] = '.wiki' local expected = { @@ -71,7 +71,7 @@ describe("get_anchors_and_paths", function() end) describe("get_all_files", function() - it("should recurse into directories if recursive argument passed in ", + it("should recurse into directories if recursive argument passed in", function() local files = { {"1910271456 testfile.md", "file"}, @@ -91,7 +91,7 @@ describe("get_all_files", function() end, fs_scandir_next = function() if #files == 0 then return nil end - local fname, ftype = unpack(table.remove(files)) + local fname, ftype = table.unpack(table.remove(files)) return fname, ftype end })