From 341e61154715c7e0f9f4eee7dd90580202735db7 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 28 Mar 2013 10:04:39 +0100 Subject: determine_constant_from_test_name does not swallow NoMethodErrors [Yves Senn] --- activesupport/test/testing/constant_lookup_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport/test/testing') 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 -- cgit v1.2.3