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 | |
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')
-rw-r--r-- | test/functional/clipboard/clipboard_provider_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/plugin/health_spec.lua | 34 | ||||
-rw-r--r-- | test/functional/provider/ruby_spec.lua | 2 |
3 files changed, 32 insertions, 10 deletions
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index b90335e70a..a3ea3b568f 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -100,7 +100,7 @@ describe('clipboard', function() ^ | ~ | ~ | - clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) @@ -112,7 +112,7 @@ describe('clipboard', function() feed_command('redir @+> | bogus_cmd | redir END') screen:expect([[ ~ | - clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | E492: Not an editor command: bogus_cmd | redir END | Press ENTER or type command to continue^ | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) @@ -132,7 +132,7 @@ describe('clipboard', function() ^ | ~ | ~ | - clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) 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 diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua index 9f5ef3b3fc..c70f90da1c 100644 --- a/test/functional/provider/ruby_spec.lua +++ b/test/functional/provider/ruby_spec.lua @@ -16,7 +16,7 @@ do clear() if missing_provider('ruby') then pending( - "Cannot find the neovim RubyGem. Try :CheckHealth", + "Cannot find the neovim RubyGem. Try :checkhealth", function() end) return end |