specky/syntax/specrun.vim
branchvim-stuff
changeset 29 a0e6ddfadf82
parent 28 2b198f0a86fe
equal deleted inserted replaced
28:2b198f0a86fe 29:a0e6ddfadf82
     1 "
       
     2 " specky: syntax highlighting for rspec test output, using the
       
     3 " custom specky formatter. (rspec 2.x)
       
     4 " $Id$
       
     5 "
       
     6 
       
     7 if has("folding")
       
     8   setlocal foldmethod=syntax
       
     9 endif
       
    10 
       
    11 " Command line as it was called, inserted by Specky
       
    12 syntax match specSpeckyCmd /^Output of: .*/
       
    13 
       
    14 " Pending specs that somehow pass
       
    15 syntax keyword specCallout FIXED
       
    16 
       
    17 " Passed specs
       
    18 syntax match specPassed /.*(\d\+.\d\+s)/ contains=specDuration,specBoxLine
       
    19 syntax keyword specPassedKeyword Succeeded
       
    20 
       
    21 " Pending specs
       
    22 syntax match specPending /.*PENDING: .*)$/ contains=specDuration,specBoxLine
       
    23 syntax keyword specPendingKeyword Pending
       
    24 
       
    25 " Failed specs
       
    26 syntax match specFailed /.*FAILED - #\d\+)/ contains=specDuration,specBoxLine
       
    27 syntax keyword specFailedKeyword Failed
       
    28 
       
    29 " Failure details
       
    30 syntax region specFailedDetails start="^FAILURE - #\d\+)" end="^$" fold contains=specCallout,specErrorLine
       
    31 syntax match specErrorLine /^  >>/
       
    32 
       
    33 
       
    34 " Boxes
       
    35 syntax match specBox /^\(\s\+\)\?\(+[+-]\+\||.*|\)$/ contains=specFailedKeyword,specDurationKeyword,specPendingKeyword,specPassedKeyword,specBoxContent
       
    36 syntax match specBoxContent /[a-zA-Z0-9]\+/ contained
       
    37 syntax match specBoxLine /^\(\s\+\)\?|/ contained
       
    38 
       
    39 " Spec timing
       
    40 " syntax match specDuration /\d\+\.\d\+s/ contained
       
    41 " syntax keyword specDurationKeyword Duration
       
    42 
       
    43 highlight def link specSpeckyCmd Question
       
    44 highlight def link specCallout Todo
       
    45 highlight def link specPassed MoreMsg
       
    46 highlight def link specPassedKeyword specPassed
       
    47 highlight def link specPending Function
       
    48 highlight def link specPendingKeyword specPending
       
    49 highlight def link specFailed WarningMsg
       
    50 highlight def link specFailedKeyword specFailed
       
    51 highlight def link specFailedDetails specFailed
       
    52 highlight def link specDuration Normal
       
    53 highlight def link specBox LineNr
       
    54 highlight def link specBoxContent Constant
       
    55 highlight def link specBoxLine LineNr
       
    56 highlight def link specErrorLine ErrorMsg
       
    57 
       
    58 let b:current_syntax = "specrun"
       
    59