rogerdpack
2010-Feb-25 15:29 UTC
[rspec-users] 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
David Chelimsky
2010-Feb-25 15:41 UTC
[rspec-users] rspec "output which test it is running before running it"
On Feb 25, 2010, at 9:29 AM, rogerdpack <rogerpack2005 at gmail.com> 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> > 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 > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Matt Wynne
2010-Feb-25 15:44 UTC
[rspec-users] rspec "output which test it is running before running it"
Do you mean --format specdoc ? On 25 Feb 2010, at 15:29, rogerdpack 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" > . > > > 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 > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-userscheers, Matt http://mattwynne.net +447974 430184
rogerdpack
2010-Feb-25 17:34 UTC
[rspec-users] rspec "output which test it is running before running it"
> spec spec --format nestedCool thanks! -r
rogerdpack
2010-Feb-25 17:47 UTC
[rspec-users] rspec "output which test it is running before running it"
On Feb 25, 8:44?am, Matt Wynne <m... at mattwynne.net> 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
David Chelimsky
2010-Feb-25 18:28 UTC
[rspec-users] rspec "output which test it is running before running it"
On Thu, Feb 25, 2010 at 11:47 AM, rogerdpack <rogerpack2005 at gmail.com> wrote:> On Feb 25, 8:44?am, Matt Wynne <m... at mattwynne.net> 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> Thanks. > -r > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Phillip Koebbe
2010-Feb-25 18:35 UTC
[rspec-users] rspec "output which test it is running before running it"
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