Skip to content

Commit 527e6fd

Browse files
committed
add details around how tests can be run; add .gvim_path file support
1 parent 39bf553 commit 527e6fd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
profile.log
22
test_indent.result
33
doc/tags
4+
.gvim_path

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,15 @@ If you get a lot of value from it, know vimscript well, or eager to learn about
8787

8888
### Running the Tests
8989

90-
Run the tests: `bundle exec parallel_rspec spec`
90+
The tests depend on having Ruby installed.
91+
They also depend on a GUI vim (gvim, mvim) with server support.
92+
If you do not have gvim or mvim in your PATH then you can create a `.gvim_path` file in the vim-elixir root directory which specifies the path to the GUI vim executable.
9193

92-
Spawn a container with vim and dev configs: `bin/vim` or `bin/nvim`
94+
To run the tests: `bundle exec parallel_rspec spec`
95+
96+
### Developing in Docker
97+
98+
You can spawn a container with vim and your development configs using `bin/vim` or `bin/nvim`
9399

94100
### Debugging Indent
95101

spec/spec_helper.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'vimrunner'
44
require 'vimrunner/rspec'
55

6+
GVIM_PATH_FILE = File.expand_path('../../.gvim_path', __FILE__)
7+
68
class Buffer
79
FOLD_PLACEHOLDER = '<!-- FOLD -->'.freeze
810

@@ -265,7 +267,12 @@ def self.new
265267
config.reuse_server = true
266268

267269
config.start_vim do
268-
VIM = Vimrunner.start_gvim
270+
VIM =
271+
if File.exists?(GVIM_PATH_FILE)
272+
Vimrunner::Server.new(executable: File.read(GVIM_PATH_FILE).rstrip).start
273+
else
274+
Vimrunner.start_gvim
275+
end
269276
VIM.add_plugin(File.expand_path('..', __dir__))
270277
cmd = ':filetype off<CR>'
271278
cmd += ':filetype plugin indent on<CR>'

0 commit comments

Comments
 (0)