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

noreply at rubyforge.org noreply at rubyforge.org
Mon Jun 18 11:22:58 EDT 2007


Patches item #10645, was opened at 2007-05-07 05:13
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10645&group_id=797

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"

http://rubyforge.org/tracker/index.php?func=detail&aid=10545&group_id=797&atid=3151


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-06-18 15:22

Message:
Here is the simple solution you were looking for, Aslak. 
I've attached it as patch3.diff

----------------------------------------------------------------------

Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-05-27 04:55

Message:
Feel free to close this one.  The last patch doesn't do what
I thought it did (Obviously I should have included specs).

I don't know a good way to get around the problem except by
implementing some logic similar to what I have done in the
first patch.  It can be cleaned up a bit, but otherwise I
don't see a way to do it simply & cleanly.  Let me know if
you have any other ideas.  Otherwise, reject it.

----------------------------------------------------------------------

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

Message:
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

Message:
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

Message:
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: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10645&group_id=797


More information about the rspec-devel mailing list