diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-10-17 22:43:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-17 22:43:46 +0200 |
commit | 0cba3da26e4612c0c8fd17dd0638d76e2dc5fae0 (patch) | |
tree | 7ffd57e014e837bd31d51e81754d92094e86de22 /test/functional/plugin | |
parent | 9467c8e16ee1fc04a9586e175fde371475c87e16 (diff) | |
parent | 3bcee71cc8ef782fc89de7d72cb784cfb6d984d3 (diff) | |
download | rneovim-0cba3da26e4612c0c8fd17dd0638d76e2dc5fae0.tar.gz rneovim-0cba3da26e4612c0c8fd17dd0638d76e2dc5fae0.tar.bz2 rneovim-0cba3da26e4612c0c8fd17dd0638d76e2dc5fae0.zip |
Merge #7399 ':checkhealth (built-in)'
Diffstat (limited to 'test/functional/plugin')
-rw-r--r-- | test/functional/plugin/health_spec.lua | 34 |
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 |