[#8136] Confused exception handling in Continuation Context — "Robert Dober" <robert.dober@...>

Hi all

13 messages 2006/07/06

[#8248] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>

I just posted this to ruby-talk. But I would also like to discuss this

33 messages 2006/07/18
[#8264] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

From my experience using both tool chains on Windows (for the ruby-prof

[#8266] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/19

Tim, I'm going to top reply since your post was so long. I'm interested in

[#8267] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

> Tim, I'm going to top reply since your post was so long. I'm interested in

[#8271] my sandboxing extension!! — why the lucky stiff <ruby-core@...>

I have (what feels like) very exciting news. I finally sat down to code up my

17 messages 2006/07/19

[#8430] Re: doc patch: weakref. — "Berger, Daniel" <Daniel.Berger@...>

> -----Original Message-----

19 messages 2006/07/28
[#8434] Re: doc patch: weakref. — Yukihiro Matsumoto <matz@...> 2006/07/29

Hi,

[#8436] Re: doc patch: weakref. — Daniel Berger <djberg96@...> 2006/07/29

Yukihiro Matsumoto wrote:

[#8437] Re: doc patch: weakref. — Mauricio Fernandez <mfp@...> 2006/07/29

On Sat, Jul 29, 2006 at 07:37:24PM +0900, Daniel Berger wrote:

[#8441] Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...>

I have the following code:

18 messages 2006/07/30
[#8442] Re: Inconsistency in scoping during module_eval? — nobu@... 2006/07/30

Hi,

[#8443] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/30

Why does this:

[#8445] Re: Inconsistency in scoping during module_eval? — Yukihiro Matsumoto <matz@...> 2006/07/30

Hi,

[#8454] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/31

So to clarify...

[PATCH] --fqname option to test/unit/autorunner.rb

From: jonathan gold <dev@...>
Date: 2006-07-06 21:50:37 UTC
List: ruby-core #8161
Hello,

I'd like to contribute a patch to test/unit/autorunner.rb that allows a 
new option '--fqname', which would be the logical AND of what is today 
'--testcase' with '--name'.

I have tests in files with many testcases, some of which use subclassing 
or an include to repeatedly run different variations of the same test. 
Right now, if the method "test_foo" is defined/included in both 
FooTestCase and BarTestCase, there is no way for me to tell autorunner 
to run just the "test_foo" method in the FooTestCase class. If I say 
'--testcase FooTestCase', I run all methods in FooTestCase. If I say 
'--name test_foo' then I run test_foo in both FooTestCase and in 
BarTestCase. The proposed patch allows me to say '--fqname 
FooTestCase#test_foo' and have only that single test case be run.

I'm new to the ruby community, so apologize if I'm overlooking the 
correcct way to submit code like this. I didn't see any guidelines for 
applying to become a committer or someone with the rights to request 
write access to the CVS repository, and, judging from the email threads 
on this list, the thing to do is put 'PATCH' in the subject line and 
then provide the diff (attached). Hopefully this is correct, but please 
let me know what I can do to help make things easier.

I'm looking forward to hearing from you.


jon

Attachments (1)

autorunner.diff (1.39 KB, text/x-diff)
--- lib/test/unit/autorunner.rb.orig	2006-07-06 14:52:11.000000000 -0700
+++ lib/test/unit/autorunner.rb	2006-07-06 14:51:10.000000000 -0700
@@ -153,6 +153,26 @@ module Test
             end
           end
 
+          o.on('-q', '--fqname=TESTCASE#NAME', String,
+               "Runs test NAME in TestCase TESTCASE",
+               "This switch is the logical AND of --testcase and --name.",
+               "It behaves similarly to --testcase and --name, in that the",
+               "argument can be a literal or a '/' enclosed regex. In the",
+               "case of the former, it will be checked for an exact match.",
+               "In the case of the latter, the regex will be matched",
+               "against the string created by joining a TestCase's classname",
+               "and the name of a test method with the '#' character.") do |n|
+            n = (%r{\A/(.*)/\Z} =~ n ? Regexp.new($1) : n)
+            case n
+            when Regexp
+              @filters << proc{|t| 
+                n =~ ("#{t.class.to_s}\##{t.method_name}") ? true : nil}
+            else
+              @filters << proc{|t| 
+                n == ("#{t.class.to_s}\##{t.method_name}") ? true : nil}
+            end
+          end
+
           o.on('-v', '--verbose=[LEVEL]', OUTPUT_LEVELS,
                "Set the output level (default is verbose).",
                "(" + keyword_display(OUTPUT_LEVELS) + ")") do |l|

In This Thread

Prev Next