diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2016-07-01 20:27:56 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2016-07-02 01:03:05 +0200 |
commit | 0d9593ff14a1d59b58816c830306daa1956d1220 (patch) | |
tree | 03ca3e56dd5c1a5b234a2e48d10fa9be32fbe6e7 /test/functional/options/autochdir_spec.lua | |
parent | 59487e18a7b26d8cea2c766ad5fbe17a152a5d11 (diff) | |
download | rneovim-0d9593ff14a1d59b58816c830306daa1956d1220.tar.gz rneovim-0d9593ff14a1d59b58816c830306daa1956d1220.tar.bz2 rneovim-0d9593ff14a1d59b58816c830306daa1956d1220.zip |
Tests: check 'autochdir' on startup
Diffstat (limited to 'test/functional/options/autochdir_spec.lua')
-rw-r--r-- | test/functional/options/autochdir_spec.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/options/autochdir_spec.lua b/test/functional/options/autochdir_spec.lua new file mode 100644 index 0000000000..0e293761ad --- /dev/null +++ b/test/functional/options/autochdir_spec.lua @@ -0,0 +1,18 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear = helpers.clear +local eq = helpers.eq +local getcwd = helpers.funcs.getcwd + +describe("'autochdir'", function() + it('given on the shell gets processed properly', function() + local targetdir = 'test/functional/fixtures' + + -- By default 'autochdir' is off, thus getcwd() returns the repo root. + clear(targetdir..'/tty-test.c') + local rootdir = getcwd() + + -- With 'autochdir' on, we should get the directory of tty-test.c. + clear('--cmd', 'set autochdir', targetdir..'/tty-test.c') + eq(rootdir..'/'..targetdir, getcwd()) + end) +end) |