mdr/scalariform — Issue #45: Feature request: format specs2 "acceptance" specifications
Author: etorreborre
Created: 2012-01-15 22:53:08+00:00
State: open

This feature would share some commonalities with issue #43 I think.

The idea is to align on the right a few symbols, like "^", separating "specification fragments":

```
class ParserSpec extends Specification with matcher.ParserMatchers { def is =
"Parsers for numbers" ^
p^
"beASuccess and succeedOn check if the parse succeeds" ^
{ number("1") must beASuccess } ^
{ number("1i") must beAPartialSuccess } ^
{ number must succeedOn("12") } ^
{ number must succeedOn("12ab").partially } ^
{ number must succeedOn("12").withResult(12) } ^
{ number must succeedOn("12").withResult(equalTo(12)) } ^
{ number("1") must haveSuccessResult("1") } ^
p^
"beAFailure and failOn check if the parse fails" ^
{ number must failOn("abc") } ^
{ number must failOn("abc").withMsg("string matching regex.*expected") } ^
{ number must failOn("abc").withMsg(matching(".*string matching regex.*expected.*")) } ^
{ number("i") must beAFailure } ^
{ number("i") must haveFailureMsg("i' found") } ^
p^
"beAnError and errorOn check if the parser errors out completely" ^
{ error must errorOn("") } ^
{ error("") must beAnError } ^
end

val parsers = NumberParsers
}
```

Maybe this is something I could do as a patch if you can give me some guidance on where to start.

Thanks.