From b68fcc6bb2c770495ff8e2508c06dfdd49abcc80 Mon Sep 17 00:00:00 2001 From: William Boman Date: Thu, 21 Apr 2022 12:09:59 +0200 Subject: chore: refactor remaining installers to async impl (#616) --- tests/core/fs_spec.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/core/fs_spec.lua (limited to 'tests/core/fs_spec.lua') diff --git a/tests/core/fs_spec.lua b/tests/core/fs_spec.lua new file mode 100644 index 00000000..121c57d6 --- /dev/null +++ b/tests/core/fs_spec.lua @@ -0,0 +1,24 @@ +local fs = require "nvim-lsp-installer.core.fs" +local lsp_installer = require "nvim-lsp-installer" + +describe("fs", function() + before_each(function() + lsp_installer.settings { + install_root_dir = "/foo", + } + end) + + it( + "refuses to rmrf paths outside of boundary", + async_test(function() + local e = assert.has.errors(function() + fs.rmrf "/thisisa/path" + end) + + assert.equal( + [[Refusing to rmrf "/thisisa/path" which is outside of the allowed boundary "/foo". Please report this error at https://github.com/williamboman/nvim-lsp-installer/issues/new]], + e + ) + end) + ) +end) -- cgit v1.2.3-70-g09d2