[rspec-devel] [ rspec-Patches-10645 ] removal of --examples when appropriate

noreply at rubyforge.org noreply at rubyforge.org
Fri May 11 18:31:14 EDT 2007

Patches item #10645, was opened at 2007-05-07 05:13
You can respond by visiting: 

Category: runner module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Scott Taylor (smtlaissezfaire)
Assigned to: Nobody (None)
Summary: removal of --examples when appropriate

Initial Comment:

See ticket: #10545	

"Removal of --options when appropriate"


David/Aslak: I added a an attribute reader for @where in the base text formatter, and called the method output.  Feel free to change this as you wish.  It is only referenced in the Options class, under the method I've added: remove_extraneous_examples!


>Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-05-11 22:31

Well, now that I look at it, it appears as though it isn't
that simple, because if you want the example switch to touch
the file, it *needs to know* that it is a file, and not a
simple example (this is why there was the complicated logic
in my patch).

On the other hand, the --formatter switch does touch the file.  

So the bug looks like it only occurs when you specify
--examples before --formatter, because ::OptionParser parses
options sequentially, as they are given on the command line.

I've opted for a low-tech solution (in this version of the
patch), so that --help will specify that --examples should
come after the corresponding formatter.

Another low-tech solution exists, of course, and that would
be to have an --example switch which only processes named
examples, and an --example-file switch which would process a
 formatted file.


Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-05-10 20:01

I agree, Aslak.  Although I don't think touch would be the
appropriate thing to use here, because it modifies the
mtimes, and that would be a problem for autotest.  

I'll rework the code.

btw: thanks for applying the other patch


Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-10 13:41

I'm not so keen on applying this. It seems like a complicated solution to a simple problem. An easier solution is this:

$ touch previous_failures.txt


You can respond by visiting: 

More information about the rspec-devel mailing list