Skip to content

Commit

Permalink
Merge pull request #52 from styx/master
Browse files Browse the repository at this point in the history
Support Elixir's ExUnit
  • Loading branch information
skalnik committed Nov 6, 2014
2 parents 3939a2a + 066ff0e commit ffc2985
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autoload/vroom.vim
Expand Up @@ -9,6 +9,10 @@ if !exists("g:vroom_spec_command")
let g:vroom_spec_command = 'rspec '
endif

if !exists("g:vroom_mix_command")
let g:vroom_mix_test_command = 'mix test '
endif

if !exists("g:vroom_use_colors")
let g:vroom_use_colors = !has('gui_running')
endif
Expand Down Expand Up @@ -126,7 +130,7 @@ endfunction
" next time the function is called in a non-test file, it runs the last test
function s:RunTestFile(args)
" Run the tests for the previously-marked file.
let in_test_file = match(expand("%"), '\(.feature\|_spec.rb\|_test.rb\)$') != -1
let in_test_file = match(expand("%"), '\(.feature\|_spec.rb\|_test.exs\|_test.rb\)$') != -1

if in_test_file
call s:SetTestFile()
Expand Down Expand Up @@ -179,6 +183,8 @@ function s:DetermineRunner(filename)
return s:test_runner_prefix . g:vroom_cucumber_path . g:vroom_cucumber_options . s:color_flag
elseif match(a:filename, "_test.rb") != -1
return s:test_runner_prefix . g:vroom_test_unit_command
elseif match(a:filename, "_test.exs") != -1
return g:vroom_mix_test_command . s:color_flag
end
endfunction

Expand Down
5 changes: 5 additions & 0 deletions doc/vroom.txt
Expand Up @@ -94,6 +94,11 @@ g:vroom_detect_spec_helper *vroom_detect_spec_helper*
requires 'spec_helper'
Default: 0

g:vroom_mix_test_command *vroom_mix_test_command*
If set, the path for the executable
used to run ExUnit test files.
Default: 'mix test '

g:vroom_use_vimux *vroom_use_vimux*
Run tests using the vimux plugin

Expand Down

0 comments on commit ffc2985

Please sign in to comment.