aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/shada_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-05 10:25:49 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-05 23:55:57 +0200
commit330a6713bf888b1b612a1ebebb5d95bb0b31cd53 (patch)
treea06fb188af5c808f31d808e7183cab0dbde23e64 /test/functional/plugin/shada_spec.lua
parent7086751c5e4eb3cfee0b98df0d3cedc8bff47d35 (diff)
downloadrneovim-330a6713bf888b1b612a1ebebb5d95bb0b31cd53.tar.gz
rneovim-330a6713bf888b1b612a1ebebb5d95bb0b31cd53.tar.bz2
rneovim-330a6713bf888b1b612a1ebebb5d95bb0b31cd53.zip
test: Eliminate plugin/helpers.lua
Diffstat (limited to 'test/functional/plugin/shada_spec.lua')
-rw-r--r--test/functional/plugin/shada_spec.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua
index 1482d83ee6..778dc4e219 100644
--- a/test/functional/plugin/shada_spec.lua
+++ b/test/functional/plugin/shada_spec.lua
@@ -1,4 +1,6 @@
+local paths = require('test.config.paths')
local helpers = require('test.functional.helpers')(after_each)
+local clear = helpers.clear
local eq, nvim_eval, nvim_command, nvim, exc_exec, funcs, nvim_feed, curbuf =
helpers.eq, helpers.eval, helpers.command, helpers.nvim, helpers.exc_exec,
helpers.funcs, helpers.feed, helpers.curbuf
@@ -7,12 +9,21 @@ local read_file = helpers.read_file
local mpack = require('mpack')
-local plugin_helpers = require('test.functional.plugin.helpers')
-local reset = plugin_helpers.reset
-
local shada_helpers = require('test.functional.shada.helpers')
local get_shada_rw = shada_helpers.get_shada_rw
+local function reset(shada_file)
+ -- TODO(justinmk): why is this needed?
+ local rtp_value = ('\'%s/runtime\''):format(
+ paths.test_source_path:gsub('\'', '\'\''))
+ clear{args_rm={'-u', '-i'},
+ args={'-u', 'NORC',
+ '-i', shada_file or 'NONE',
+ '--cmd', 'set laststatus&',
+ '--cmd', 'let &runtimepath='..rtp_value,
+ }}
+end
+
local mpack_eq = function(expected, mpack_result)
local mpack_keys = {'type', 'timestamp', 'length', 'value'}