Added start of jasmine compiler for :make

Map <leader>m in jasmine buffers to :make, which is rake -f Rakefile
jasmine:ci
This commit is contained in:
Christopher H. Laco 2011-02-03 23:12:10 -05:00
parent cf5642dd06
commit 34ce6b2e31
4 changed files with 17 additions and 1 deletions

View File

@ -39,6 +39,7 @@ By default, the plugin assumes the templates are in bundle/jasmine/template and
h2. Running Specs
I'm slowly working on interactive spec running support. Currently, the Jasmine() command is provided for jasmine buffers. When invoked, it searches the current/parent directories of that buffer for the nearest Rakefile and invokes rake jasmine:ci to run all specs.
Jasmine buffers now have compiler set to the jasmine compiler and <leader>m is mapped to run :Jasmine -> jasmine#un_tests -> :make -> rake jasmine:ci
I plan on adding Red/Green support, as well as quickfix error support.

View File

@ -72,7 +72,7 @@ endfunction
function jasmine#run_tests()
let b:jasmine_root = jasmine#find_root()
execute "!rake --rakefile=\"".b:jasmine_rakefile."\" jasmine:ci"
execute "make --rakefile=\"".b:jasmine_rakefile."\" jasmine:ci"
endfunction
function jasmine#redbar()

12
compiler/jasmine.vim Normal file
View File

@ -0,0 +1,12 @@
if exists("current_compiler")
finish
endif
let current_compiler = "jasmine"
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=rake "$*"
CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m

View File

@ -4,6 +4,9 @@ endif
let b:did_ftplugin = 1
compiler jasmine
map <buffer> <leader>m :Jasmine<CR>
call jasmine#load_snippets()
command! Jasmine :call jasmine#run_tests()