author | Mahlon E. Smith <mahlon@martini.nu> |
Fri, 10 Feb 2012 16:08:43 -0800 | |
branch | vim-stuff |
changeset 22 | ed72213b1788 |
parent 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 |
21
cd1f3381c1ed
Emit file and line for failure source (use gF to jump straight to it!).
Mahlon E. Smith <mahlon@martini.nu>
parents:
19
diff
changeset
|
30 |
syntax region specFailedDetails start="^FAILURE - #\d\+)" end="^$" fold contains=specCallout,specErrorLine |
cd1f3381c1ed
Emit file and line for failure source (use gF to jump straight to it!).
Mahlon E. Smith <mahlon@martini.nu>
parents:
19
diff
changeset
|
31 |
syntax match specErrorLine /^ >>/ |
cd1f3381c1ed
Emit file and line for failure source (use gF to jump straight to it!).
Mahlon E. Smith <mahlon@martini.nu>
parents:
19
diff
changeset
|
32 |
|
19
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
33 |
|
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
34 |
" Boxes |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
35 |
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
|
36 |
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
|
37 |
syntax match specBoxLine /^\(\s\+\)\?|/ contained |
2 | 38 |
|
19
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
39 |
" Spec timing |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
40 |
" 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
|
41 |
" syntax keyword specDurationKeyword Duration |
2 | 42 |
|
19
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
43 |
highlight def link specSpeckyCmd Question |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
44 |
highlight def link specCallout Todo |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
45 |
highlight def link specPassed MoreMsg |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
46 |
highlight def link specPassedKeyword specPassed |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
47 |
highlight def link specPending Function |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
48 |
highlight def link specPendingKeyword specPending |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
49 |
highlight def link specFailed WarningMsg |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
50 |
highlight def link specFailedKeyword specFailed |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
51 |
highlight def link specFailedDetails specFailed |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
52 |
highlight def link specDuration Normal |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
53 |
highlight def link specBox LineNr |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
54 |
highlight def link specBoxContent Constant |
763cef799c74
Specky: support rspec 2.x by default.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
55 |
highlight def link specBoxLine LineNr |
21
cd1f3381c1ed
Emit file and line for failure source (use gF to jump straight to it!).
Mahlon E. Smith <mahlon@martini.nu>
parents:
19
diff
changeset
|
56 |
highlight def link specErrorLine ErrorMsg |
2 | 57 |
|
58 |
let b:current_syntax = "specrun" |
|
59 |