robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
1.0 KiB33 linesraw
1local t = require('test.testutil')
2local n = require('test.functional.testnvim')()
3
4local describe, it, before_each = t.describe, t.it, t.before_each
5local clear, eval = n.clear, n.eval
6local command = n.command
7local eq = t.eq
8local pcall_err = t.pcall_err
9
10describe('providers', function()
11  before_each(function()
12    clear('--cmd', 'set rtp^=test/functional/fixtures')
13  end)
14
15  it('with #Call(), missing g:loaded_xx_provider', function()
16    command('set loadplugins')
17    -- Using test-fixture with broken impl:
18    -- test/functional/fixtures/autoload/provider/python.vim
19    eq(
20      'Vim:provider: python3: missing required variable g:loaded_python3_provider',
21      pcall_err(eval, "has('python3')")
22    )
23  end)
24
25  it('with g:loaded_xx_provider, missing #Call()', function()
26    -- Using test-fixture with broken impl:
27    -- test/functional/fixtures/autoload/provider/ruby.vim
28    eq(
29      'Vim:provider: ruby: g:loaded_ruby_provider=2 but provider#ruby#Call is not defined',
30      pcall_err(eval, "has('ruby')")
31    )
32  end)
33end)