aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/health_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/plugin/health_spec.lua')
-rw-r--r--test/functional/plugin/health_spec.lua26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua
index 8646ec98bf..a85a3ce495 100644
--- a/test/functional/plugin/health_spec.lua
+++ b/test/functional/plugin/health_spec.lua
@@ -2,7 +2,29 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local plugin_helpers = require('test.functional.plugin.helpers')
+local clear = helpers.clear
local command = helpers.command
+local eq = helpers.eq
+
+describe(':checkhealth', function()
+ it("detects invalid $VIMRUNTIME", function()
+ clear({
+ env={ VIMRUNTIME='bogus', },
+ })
+ local status, err = pcall(command, 'checkhealth')
+ eq(false, status)
+ eq('Invalid $VIMRUNTIME: bogus', string.match(err, 'Invalid.*'))
+ end)
+ it("detects invalid $VIM", function()
+ clear({
+ env={ VIM='bogus', },
+ })
+ local status, err = pcall(command, 'checkhealth')
+ eq(false, status)
+ -- Invalid $VIM causes $VIMRUNTIME to be broken.
+ eq('Invalid $VIMRUNTIME: bogus', string.match(err, 'Invalid.*'))
+ end)
+end)
describe('health.vim', function()
before_each(function()
@@ -14,7 +36,7 @@ describe('health.vim', function()
command("set runtimepath+=test/functional/fixtures")
end)
- it("reports", function()
+ it("health#report_*()", function()
helpers.source([[
let g:health_report = execute([
\ "call health#report_start('Check Bar')",
@@ -44,7 +66,7 @@ describe('health.vim', function()
end)
- describe(":CheckHealth", function()
+ describe(":checkhealth", function()
it("concatenates multiple reports", function()
command("CheckHealth success1 success2")
helpers.expect([[