Rspec "output which test it is running before running it"

I’m trying to find a spec parameter that will do something like the
following

$ spec file.spec

Spec: running “it should pass spec x”
.
Spec: running “it should pass spec y”
.

That type of thing.

The use case is that “one” of my tests is outputting some weird stuff
and I want to narrow down on which one it is easily.

Does such a thing exist? If not would a patch for it be welcome?
Thanks.
-r

On Feb 25, 2010, at 9:29 AM, rogerdpack [email protected] wrote:

I’m trying to find a spec parameter that will do something like the
following

$ spec file.spec

Spec: running “it should pass spec x”
.
Spec: running “it should pass spec y”
.

In rspec-1:

spec spec --format nested

In rspec-2;

rspec spec --format doc

HTH,
David

Do you mean --format specdoc ?

On 25 Feb 2010, at 15:29, rogerdpack wrote:

[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

cheers,
Matt

+447974 430184

On Feb 25, 8:44 am, Matt W. [email protected] wrote:

Do you mean --format specdoc ?

Interesting.
It appears that with both specdoc and --format nested, it outputs the
test name after running it. I would have expected the opposite. Is
this expected?
Thanks.
-r

spec spec --format nested

Cool thanks!
-r

rogerdpack wrote:

Interesting.
It appears that with both specdoc and --format nested, it outputs the
test name after running it. I would have expected the opposite. Is
this expected?
Thanks.
-r

Yes. RSpec needs to know if the test passed or failed so it knows how to
color it.

At least, that’s my layman’s guess.

Peace,
Phillip

On Thu, Feb 25, 2010 at 11:47 AM, rogerdpack [email protected]
wrote:

On Feb 25, 8:44 am, Matt W. [email protected] wrote:

Do you mean --format specdoc ?

Interesting.
It appears that with both specdoc and --format nested, it outputs the
test name after running it. I would have expected the opposite. Is
this expected?

Actually it is (now that you mention it). The reason is that each
example reports whether it passed or failed, which it clearly can’t
know until it’s run.

Another solution for your issue would be to write a custom formatter:
http://wiki.github.com/dchelimsky/rspec/custom-formatters

HTH,
David