Skip to content

Commit

Permalink
Remove explicit Dispatch support
Browse files Browse the repository at this point in the history
Test runners and pre-loaders that require a different command to be run
should be enabled by setting `g:rspec_command` in your .vimrc. The
pre-existing support for Dispatch didn't work if you loaded vim-rspec
before Dispatch. Rather than work around this or any other
runner/pre-loader issues, we should leave it up to the user to set the
command.
  • Loading branch information
derekprior committed May 3, 2013
1 parent 058e71d commit ef5e7ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
* 2013-05-03 - Removed explicit support for Dispatch because it introduces a
load order dependency. Set `g:rspec_command` in your .vimrc if you want to
use Dispatch or any other test runner.
* 2013-04-11 - `RunCurrentSpecFile` and `RunNearestSpec` will fall back to
`RunLastSpec` if not in spec file.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Example:
let g:rspec_command = "!rspec --drb {spec}"
```

This `g:rspec_command` variable can be used to support any number of test
runners or pre-loaders. For example, you can use
[Dispatch](https://github.com/tpope/dispatch) and
[Zeus](https://github.com/burke/zeus) together with the following:

```vim
let g:rspec_command = "Dispatch zeus rspec {spec}"
```

## License

rspec.vim is copyright © 2013 thoughtbot. It is free software, and may be
Expand Down
11 changes: 4 additions & 7 deletions plugin/rspec.vim
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
let s:plugin_path = expand("<sfile>:p:h:h")

if !exists("g:rspec_command")
let s:cmd = "rspec {spec}"

if has("gui_running") && has("gui_macvim")
let g:rspec_command = "silent !" . s:plugin_path . "/bin/run_in_os_x_terminal 'rspec {spec}'"
let g:rspec_command = "silent !" . s:plugin_path . "/bin/run_in_os_x_terminal '" . s:cmd . "'"
else
let s:cmd = "rspec {spec}"
if exists(":Dispatch")
let g:rspec_command = "Dispatch " . s:cmd
else
let g:rspec_command = "!echo " . s:cmd . " && " . s:cmd
endif
let g:rspec_command = "!echo " . s:cmd . " && " . s:cmd
endif
endif

Expand Down

0 comments on commit ef5e7ec

Please sign in to comment.