Skip to content

Commit

Permalink
Added start of jasmine compiler for :make
Browse files Browse the repository at this point in the history
Map <leader>m in jasmine buffers to :make, which is rake -f Rakefile
jasmine:ci
  • Loading branch information
claco committed Feb 4, 2011
1 parent cf5642d commit 34ce6b2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.textile
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion autoload/jasmine.vim
Expand Up @@ -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()
Expand Down
12 changes: 12 additions & 0 deletions compiler/jasmine.vim
@@ -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
3 changes: 3 additions & 0 deletions ftplugin/jasmine.vim
Expand Up @@ -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()

0 comments on commit 34ce6b2

Please sign in to comment.