specky/syntax/specrun.vim
author mahlon
Mon, 20 Apr 2009 00:57:06 +0000
branchvim-stuff
changeset 6 31d00503e038
parent 2 6b33188f1694
child 19 763cef799c74
permissions -rw-r--r--
* Small documentation updates * Removed g:speckyVertSplit option if favor of g:speckyWindowType, which also supports opening rDoc and spec output in a tabbed window. The default is now tabbed window -- use 'g:speckyWindowType = 2' to replicate the old behavior. * Support syntax highlighting for 'pending' specs that are implemented and expected to fail, instead of just pendings for 'not implemented yet'. * Allow rdoc lookups from within spec mode. * Add ftplugin for rspec, so rspec files behaviorally act the same as ruby. * Banner creation now respects current indentation level.

"
" specky: syntax highlighting for the 'spec' script output
" $Id$
"

if has("folding")
  setlocal foldmethod=syntax
endif

" Command line as it was called, inserted by Specky
"
syntax match specSpeckyCmd /^Output of: .*/
highlight link specSpeckyCmd Question
"syntax match WarningMsg /\.\./

" Plain output block (...P..F...)
"
syntax region specPlain start="^[\.PF]\+" end="^$" contains=specFailedPlain,specPendingPlain
highlight link specPlain MoreMsg

" Passed specs (specdoc output)
"
syntax match specPassed /^- .*/ contains=specFailed,specPending
highlight link specPassed MoreMsg

" Pending specs (specdoc output)
"
syntax match specPending /.*PENDING: .*)$/ contained
highlight link specPending Function
"
" (Plain output)
syntax match specPendingPlain /P/ contained
highlight link specPendingPlain Function

" Failed specs (specdoc output)
"
syntax match specFailed /.*\(FAILED\|ERROR\) - \d\+)/ contained
highlight link specFailed WarningMsg
"
" (Plain output)
syntax match specFailedPlain /F/ contained
highlight link specFailedPlain WarningMsg

" Warning details
"
syntax region specFailedDetails start="^\d\+)" end="^$" fold
highlight link specFailedDetails WarningMsg

" Pending specs
"
syntax region specPendingDetails start="^Pending:" end="^$" fold
highlight link specPendingDetails Function

" Timing information
"
syntax match specTimedRun /^Finished in.*/
highlight link specTimedRun Question

" Status summary
"
syntax match specExamplesTotal /^\d\+ examples, .\+/ contains=specTotalFailed,specNoFailures,specTotalPending
highlight link specExamplesTotal Special
"
syntax match specTotalFailed /\d\+ failure\%[s]/ contained
highlight link specTotalFailed WarningMsg
"
syntax match specTotalPending /\d pending/ contained
highlight link specTotalPending Function
"
syntax match specNoFailures /0 failures/ contained
highlight link specNoFailures MoreMsg


let b:current_syntax = "specrun"