aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-10-30 00:49:12 +0300
committerZyX <kp-pav@yandex.ru>2017-10-30 00:49:12 +0300
commitb29a776550dadefefb891d01054ea21eb942bad1 (patch)
tree799bb2c0e926a20ac5b1af262f0849208eae699a /test/functional/plugin
parent538af1c90a4ac9928f60e97338869e516def4956 (diff)
parent45296b331fa462eeabb141037ad10a3ad24ab8a6 (diff)
downloadrneovim-b29a776550dadefefb891d01054ea21eb942bad1.tar.gz
rneovim-b29a776550dadefefb891d01054ea21eb942bad1.tar.bz2
rneovim-b29a776550dadefefb891d01054ea21eb942bad1.zip
Merge branch 'master' into expression-parser
Diffstat (limited to 'test/functional/plugin')
-rw-r--r--test/functional/plugin/health_spec.lua34
1 files changed, 28 insertions, 6 deletions
diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua
index 8646ec98bf..b5374210e6 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 curbuf_contents = helpers.curbuf_contents
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()
+ -- Do this after startup, otherwise it just breaks $VIMRUNTIME.
+ command("let $VIM='zub'")
+ command("checkhealth nvim")
+ eq("ERROR: $VIM is invalid: zub",
+ string.match(curbuf_contents(), "ERROR: $VIM .* zub"))
+ 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,9 +66,9 @@ describe('health.vim', function()
end)
- describe(":CheckHealth", function()
+ describe(":checkhealth", function()
it("concatenates multiple reports", function()
- command("CheckHealth success1 success2")
+ command("checkhealth success1 success2")
helpers.expect([[
health#success1#check
@@ -65,7 +87,7 @@ describe('health.vim', function()
end)
it("gracefully handles broken healthcheck", function()
- command("CheckHealth broken")
+ command("checkhealth broken")
helpers.expect([[
health#broken#check
@@ -89,7 +111,7 @@ describe('health.vim', function()
Bar = { foreground=Screen.colors.Purple },
Bullet = { bold=true, foreground=Screen.colors.Brown },
})
- command("CheckHealth foo success1")
+ command("checkhealth foo success1")
command("1tabclose")
command("set laststatus=0")
screen:expect([[
@@ -107,7 +129,7 @@ describe('health.vim', function()
end)
it("gracefully handles invalid healthcheck", function()
- command("CheckHealth non_existent_healthcheck")
+ command("checkhealth non_existent_healthcheck")
helpers.expect([[
health#non_existent_healthcheck#check