maltize/sublime-text-2-ruby-tests — pull request #50 by j2fly (2012-02-24 21:17:55+00:00)
Title: Enhance cucumber coloring

Added some custom regex matchers for the tmLanguage and tmTheme to more closely resemble the actual colored command line output.

http://cl.ly/EVQA

and

http://cl.ly/EUOX

However, I can't seem to get the 'dot matches newline' option (or any options) to work in a tmLanguage file. I'm trying to highlight all of the section between the "expected: blah" and the next step. I planned to build upon this and highlight the remaining (pending) steps after a failure and see if I could use some look-behind regex to highlight the green steps before a failure as well.

This was my attempt at highlighting the expected: block

http://rubular.com/r/JccQhKsJHA

I thought using this:

(?imx-m:expected:.+?(\s{4}Given|\s{4}When|\s{4}Then|\s{4}And|\s{4}But)

might work, but it doesn't match on newlines.

In fact, this (below) doesn't even work to highlight the rest of the output red (obviously we wouldn't want that ultimately, but I couldn't even get it to work):

(?imx-m:expected:.+)

I also tried:

(?m:expected:.+)

as I'm not sure what the syntax actually is for specifying options in a regex of a tmlanguage file. I couldn't find a clear example.

Would love to hear your thoughts!

Thanks much,
-Jon