I have created an inherited TestCase object. When running the TestSuite with -n /Regexp/ Ruby pukes.
The error:
f:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:132:in `=~': cannot convert Symbol
into String (TypeError)
from f:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:134:in `options'
from f:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:132:in `[]'
from f:/ruby/lib/ruby/1.8/test/unit/collector.rb:26:in `include?'
from f:/ruby/lib/ruby/1.8/test/unit/collector.rb:25:in `each'
from f:/ruby/lib/ruby/1.8/test/unit/collector.rb:25:in `include?'
from f:/ruby/lib/ruby/1.8/test/unit/collector.rb:18:in `add_suite'
from f:/ruby/lib/ruby/1.8/test/unit/collector.rb:18:in `find_all'
from f:/ruby/lib/ruby/1.8/test/unit/collector.rb:18:in `each'
... 7 levels...
from f:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:194:in `run'
from f:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:14:in `run'
from f:/ruby/lib/ruby/1.8/test/unit.rb:285
from f:/ruby/lib/ruby/1.8/test/unit.rb:283
The actual Code is:
autorunner.rb: line 132
Was: @filters << proc{|t| n =~ t.method_name ? true : nil}
Changed: @filters << proc{|t| n =~ t.method_name.to_s ? true : nil}
When I would run the thing, I found that the default_test method, which I am consequently refusing to run but overwriting
my class, it would return a Class type of "Symbol". By putting in the .to_s method call, the system is then
able to compensate appropriately.
I hope this makes sense.
My Inherited class overwrites the Run method with the following:
def run(*args) #:nodoc:
return if @method_name.to_s == "default_test"
super
end
I do this so that I can exclude the default_test object from my class.
Thanks for a great product!
|