provider_spec.lua 979 B

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