aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-04 03:54:06 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-04 13:23:46 +0200
commit66938b928c05b913f3a11e520d13ca854621799d (patch)
treecd6a7cf32d92341e3ea82c8893b196aac4ed8f8b /test
parent2cfe4748e57bd510b98ca81bd915f801f5a50bb5 (diff)
downloadrneovim-66938b928c05b913f3a11e520d13ca854621799d.tar.gz
rneovim-66938b928c05b913f3a11e520d13ca854621799d.tar.bz2
rneovim-66938b928c05b913f3a11e520d13ca854621799d.zip
provider: decide status by g:loaded_xx_provider
Diffstat (limited to 'test')
-rw-r--r--test/functional/fixtures/autoload/provider/brokencall.vim2
-rw-r--r--test/functional/fixtures/autoload/provider/brokenenabled.vim4
-rw-r--r--test/functional/fixtures/autoload/provider/clipboard.vim4
-rw-r--r--test/functional/provider/provider_spec.lua16
4 files changed, 14 insertions, 12 deletions
diff --git a/test/functional/fixtures/autoload/provider/brokencall.vim b/test/functional/fixtures/autoload/provider/brokencall.vim
index 2c83dd2b4a..7dc5d828d2 100644
--- a/test/functional/fixtures/autoload/provider/brokencall.vim
+++ b/test/functional/fixtures/autoload/provider/brokencall.vim
@@ -1,2 +1,2 @@
" A dummy test provider
-let g:provider#brokencall#enabled = 1
+let g:loaded_brokencall_provider = 1
diff --git a/test/functional/fixtures/autoload/provider/brokenenabled.vim b/test/functional/fixtures/autoload/provider/brokenenabled.vim
index 54ed11cedc..dd33ce66f3 100644
--- a/test/functional/fixtures/autoload/provider/brokenenabled.vim
+++ b/test/functional/fixtures/autoload/provider/brokenenabled.vim
@@ -1,5 +1,5 @@
-" Dummy test provider, missing
-" let g:provider#brokenenabled#enabled = 0
+" Dummy test provider, missing this required variable:
+" let g:loaded_brokenenabled_provider = 0
function! provider#brokenenabled#Call(method, args)
return 42
diff --git a/test/functional/fixtures/autoload/provider/clipboard.vim b/test/functional/fixtures/autoload/provider/clipboard.vim
index d1ddd81b12..efa9f82bd4 100644
--- a/test/functional/fixtures/autoload/provider/clipboard.vim
+++ b/test/functional/fixtures/autoload/provider/clipboard.vim
@@ -1,3 +1,5 @@
+let g:loaded_clipboard_provider = 1
+
let g:test_clip = { '+': [''], '*': [''], }
let s:methods = {}
@@ -35,8 +37,6 @@ function! s:methods.set(lines, regtype, reg)
let g:test_clip[a:reg] = [a:lines, a:regtype]
endfunction
-let provider#clipboard#enabled = 1
-
function! provider#clipboard#Call(method, args)
return call(s:methods[a:method],a:args,s:methods)
endfunction
diff --git a/test/functional/provider/provider_spec.lua b/test/functional/provider/provider_spec.lua
index 6f414f36f4..b690cf2566 100644
--- a/test/functional/provider/provider_spec.lua
+++ b/test/functional/provider/provider_spec.lua
@@ -1,19 +1,21 @@
local helpers = require('test.functional.helpers')(after_each)
-local clear, eq, feed_command, eval = helpers.clear, helpers.eq, helpers.feed_command, helpers.eval
+local clear, eq, eval = helpers.clear, helpers.eq, helpers.eval
+local command = helpers.command
+local expect_err = helpers.expect_err
-describe('Providers', function()
+describe('providers', function()
before_each(function()
clear('--cmd', 'let &rtp = "test/functional/fixtures,".&rtp')
end)
- it('must set the enabled variable or fail', function()
- eq(42, eval("provider#brokenenabled#Call('dosomething', [])"))
- feed_command("call has('brokenenabled')")
- eq(0, eval("has('brokenenabled')"))
+ it('must define g:loaded_xx_provider', function()
+ command('set loadplugins')
+ expect_err('Vim:provider: brokenenabled: missing required variable g:loaded_brokenenabled_provider',
+ eval, "has('brokenenabled')")
end)
- it('without Call() are enabled', function()
+ it('without Call() but with g:loaded_xx_provider', function()
eq(1, eval("has('brokencall')"))
end)
end)