aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/testing
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-03-28 10:04:39 +0100
committerXavier Noria <fxn@hashref.com>2013-03-28 10:04:39 +0100
commit341e61154715c7e0f9f4eee7dd90580202735db7 (patch)
treeef56a826149c4f9803278a498c170ddf439e232b /activesupport/test/testing
parent0417bc83164422119ab2dc4da92ec6ddff5a3d2f (diff)
downloadrails-341e61154715c7e0f9f4eee7dd90580202735db7.tar.gz
rails-341e61154715c7e0f9f4eee7dd90580202735db7.tar.bz2
rails-341e61154715c7e0f9f4eee7dd90580202735db7.zip
determine_constant_from_test_name does not swallow NoMethodErrors [Yves Senn]
Diffstat (limited to 'activesupport/test/testing')
-rw-r--r--activesupport/test/testing/constant_lookup_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/testing/constant_lookup_test.rb b/activesupport/test/testing/constant_lookup_test.rb
index 19280ba74a..aca2951450 100644
--- a/activesupport/test/testing/constant_lookup_test.rb
+++ b/activesupport/test/testing/constant_lookup_test.rb
@@ -1,4 +1,5 @@
require 'abstract_unit'
+require 'dependencies_test_helpers'
class Foo; end
class Bar < Foo
@@ -10,6 +11,7 @@ module FooBar; end
class ConstantLookupTest < ActiveSupport::TestCase
include ActiveSupport::Testing::ConstantLookup
+ include DependenciesTestHelpers
def find_foo(name)
self.class.determine_constant_from_test_name(name) do |constant|
@@ -56,4 +58,12 @@ class ConstantLookupTest < ActiveSupport::TestCase
assert_nil find_module("DoesntExist::Nadda::Nope")
assert_nil find_module("DoesntExist::Nadda::Nope::NotHere")
end
+
+ def test_does_not_swallow_exception_on_no_method_error
+ assert_raises(NoMethodError) {
+ with_autoloading_fixtures {
+ self.class.determine_constant_from_test_name("RaisesNoMethodError")
+ }
+ }
+ end
end