diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-04 15:48:18 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-06 04:21:57 -0300 |
commit | 117d3db6d794b3b4547f1feb9742c9ab0c6b35c8 (patch) | |
tree | 45ce4856f1e2d9a67e13008a36b5d0774c7fba52 | |
parent | 5e5525a78bcf186a3315c22416bcb7dbab0c2ae0 (diff) | |
download | rneovim-117d3db6d794b3b4547f1feb9742c9ab0c6b35c8.tar.gz rneovim-117d3db6d794b3b4547f1feb9742c9ab0c6b35c8.tar.bz2 rneovim-117d3db6d794b3b4547f1feb9742c9ab0c6b35c8.zip |
test: Simplify/fix options_spec.lua
The options_spec.lua suite has one purpose: Check if the :options commands will
throw any exception(:options is implemented by $VIMRUNTIME/optwin.vim). For this
it is best to use the `vim_command` API function since it will automatically
catch exceptions and forward them via msgpack-rpc.
Also, the option window seems to affect other tests, so call `restart` in the
teardown hook.
-rw-r--r-- | test/functional/legacy/options_spec.lua | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/test/functional/legacy/options_spec.lua b/test/functional/legacy/options_spec.lua index fcc39434ff..983d168609 100644 --- a/test/functional/legacy/options_spec.lua +++ b/test/functional/legacy/options_spec.lua @@ -1,20 +1,14 @@ --- Test for ":options". +-- Test if ":options" throws any exception. The options window seems to mess +-- other tests, so restart nvim in the teardown hook local helpers = require('test.functional.helpers') -local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local execute, expect = helpers.execute, helpers.expect +local restart, command, clear = helpers.restart, helpers.command, helpers.clear describe('options', function() setup(clear) + teardown(restart) it('is working', function() - insert('result') - - execute("let caught = 'ok'") - execute('try', 'options', 'catch', 'let caught = v:throwpoint . "\n" . v:exception', 'endtry') - execute('buf 1') - execute('$put =caught') - - expect("result\nok") + command('options') end) end) |