Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make integration testing not interfere with command-line regex test f…

…ilters

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 24fca9d92ea9bef676f74259996c4039e014dfe2 1 parent 4d4f0e6
@jamis jamis authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 actionpack/lib/action_controller/integration_test.rb
View
12 actionpack/lib/action_controller/integration_test.rb
@@ -405,12 +405,20 @@ def new_with_capture(*args)
# end
# end
class IntegrationTest < Test::Unit::TestCase
+ # Work around a bug in test/unit caused by the default test being named
+ # as a symbol (:default_test), which causes regex test filters
+ # (like "ruby test.rb -n /foo/") to fail because =~ doesn't work on
+ # symbols.
+ def initialize(name) #:nodoc:
+ super(name.to_s)
+ end
+
# Work around test/unit's requirement that every subclass of TestCase have
# at least one test method. Note that this implementation extends to all
# subclasses, as well, so subclasses of IntegrationTest may also exist
# without any test methods.
def run(*args) #:nodoc:
- return if @method_name == :default_test
+ return if @method_name == "default_test"
super
end
@@ -490,4 +498,4 @@ def method_missing(sym, *args, &block)
@integration_session.send(sym, *args, &block)
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.