specky/syntax/specrun.vim
author Mahlon E. Smith <mahlon@martini.nu>
Sat, 18 Dec 2010 00:56:09 -0800
branchvim-stuff
changeset 19 763cef799c74
parent 6 31d00503e038
child 21 cd1f3381c1ed
permissions -rw-r--r--
Specky: support rspec 2.x by default.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     1
"
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
     2
" specky: syntax highlighting for rspec test output, using the
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
     3
" custom specky formatter. (rspec 2.x)
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     4
" $Id$
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     5
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     6
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     7
if has("folding")
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     8
  setlocal foldmethod=syntax
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     9
endif
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    10
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    11
" Command line as it was called, inserted by Specky
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    12
syntax match specSpeckyCmd /^Output of: .*/
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    13
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    14
" Pending specs that somehow pass
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    15
syntax keyword specCallout FIXED
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    16
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    17
" Passed specs
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    18
syntax match specPassed /.*(\d\+.\d\+s)/ contains=specDuration,specBoxLine
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    19
syntax keyword specPassedKeyword Succeeded
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    20
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    21
" Pending specs
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    22
syntax match specPending /.*PENDING: .*)$/ contains=specDuration,specBoxLine
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    23
syntax keyword specPendingKeyword Pending
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    24
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    25
" Failed specs
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    26
syntax match specFailed /.*FAILED - #\d\+)/ contains=specDuration,specBoxLine
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    27
syntax keyword specFailedKeyword Failed
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    28
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    29
" Failure details
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    30
syntax region specFailedDetails start="^FAILURE - #\d\+)" end="^$" fold contains=specCallout
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    31
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    32
" Boxes
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    33
syntax match specBox /^\(\s\+\)\?\(+[+-]\+\||.*|\)$/ contains=specFailedKeyword,specDurationKeyword,specPendingKeyword,specPassedKeyword,specBoxContent
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    34
syntax match specBoxContent /[a-zA-Z0-9]\+/ contained
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    35
syntax match specBoxLine /^\(\s\+\)\?|/ contained
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    36
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    37
" Spec timing
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    38
" syntax match specDuration /\d\+\.\d\+s/ contained
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    39
" syntax keyword specDurationKeyword Duration
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    40
19
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    41
highlight def link specSpeckyCmd Question
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    42
highlight def link specCallout Todo
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    43
highlight def link specPassed MoreMsg
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    44
highlight def link specPassedKeyword specPassed
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    45
highlight def link specPending Function
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    46
highlight def link specPendingKeyword specPending
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    47
highlight def link specFailed WarningMsg
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    48
highlight def link specFailedKeyword specFailed
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    49
highlight def link specFailedDetails specFailed
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    50
highlight def link specDuration Normal
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    51
highlight def link specBox LineNr
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    52
highlight def link specBoxContent Constant
763cef799c74 Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents: 6
diff changeset
    53
highlight def link specBoxLine LineNr
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    54
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    55
let b:current_syntax = "specrun"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    56