neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

provider_spec.lua (979B)


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