author | Mahlon E. Smith <mahlon@martini.nu> |
Sat, 18 Dec 2010 23:38:55 -0800 | |
branch | vim-stuff |
changeset 20 | 09c4f575f627 |
parent 19 | 763cef799c74 |
child 21 | cd1f3381c1ed |
permissions | -rw-r--r-- |
2 | 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 | 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 |
||
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 | 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 | 20 |
|
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 | 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 | 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 | 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 | 54 |
|
55 |
let b:current_syntax = "specrun" |
|
56 |