Formatting of one-line specs - question

For easy editing, I love one-line specs, like this:

specify { 1.should == 1 }

But when using ‘–format documentation’, one-line specs don’t always
render useful documentation.

A solution is to write one-line specs using do/end:

it “succeeds with do/end” do 1.should == 1 end

That’s ok - but its difficult to visually parse. One-line specs with
braces would be better IMHO.

Here’s a first example with braces ( this doesn’t work ):

it “should work this way, but doesn’t” { 1.should == 1 }

Here’s a second example with braces ( this works ):

it(“works this way”) { 1.should == 1 }

Is there any way to make the first ‘braces’ format work??

( I’m using Ruby 1.8.7 / Rspec 2.4.0 / Ubuntu 10.10 )

Thanks, Andy

On Jan 16, 2011, at 1:35 PM, andyl wrote:

Is there any way to make the first ‘braces’ format work??

AFAIK, no. That’s just the way the Ruby parser works.