Skip to content

Commit

Permalink
add details around how tests can be run; add .gvim_path file support
Browse files Browse the repository at this point in the history
  • Loading branch information
jbodah committed Mar 1, 2021
1 parent 39bf553 commit 527e6fd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
profile.log
test_indent.result
doc/tags
.gvim_path
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,15 @@ If you get a lot of value from it, know vimscript well, or eager to learn about

### Running the Tests

Run the tests: `bundle exec parallel_rspec spec`
The tests depend on having Ruby installed.
They also depend on a GUI vim (gvim, mvim) with server support.
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.

Spawn a container with vim and dev configs: `bin/vim` or `bin/nvim`
To run the tests: `bundle exec parallel_rspec spec`

### Developing in Docker

You can spawn a container with vim and your development configs using `bin/vim` or `bin/nvim`

### Debugging Indent

Expand Down
9 changes: 8 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require 'vimrunner'
require 'vimrunner/rspec'

GVIM_PATH_FILE = File.expand_path('../../.gvim_path', __FILE__)

class Buffer
FOLD_PLACEHOLDER = '<!-- FOLD -->'.freeze

Expand Down Expand Up @@ -265,7 +267,12 @@ def self.new
config.reuse_server = true

config.start_vim do
VIM = Vimrunner.start_gvim
VIM =
if File.exists?(GVIM_PATH_FILE)
Vimrunner::Server.new(executable: File.read(GVIM_PATH_FILE).rstrip).start
else
Vimrunner.start_gvim
end
VIM.add_plugin(File.expand_path('..', __dir__))
cmd = ':filetype off<CR>'
cmd += ':filetype plugin indent on<CR>'
Expand Down

0 comments on commit 527e6fd

Please sign in to comment.