diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-01-05 14:45:18 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-01-06 15:41:14 +0900 |
commit | 70ae89c321444eef42c0c011b522f926250e7acd (patch) | |
tree | 0f7abe41af87a17deb5c90465d1e9a190e4a70a9 /actionpack/test/abstract | |
parent | 3e8134a750bee5c4f7ede67f33263d36e4ff1474 (diff) | |
download | rails-70ae89c321444eef42c0c011b522f926250e7acd.tar.gz rails-70ae89c321444eef42c0c011b522f926250e7acd.tar.bz2 rails-70ae89c321444eef42c0c011b522f926250e7acd.zip |
Remove unnecessary begin..rescue..end, use only rescue
Diffstat (limited to 'actionpack/test/abstract')
-rw-r--r-- | actionpack/test/abstract/abstract_controller_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/abstract/helper_test.rb | 10 |
2 files changed, 7 insertions, 11 deletions
diff --git a/actionpack/test/abstract/abstract_controller_test.rb b/actionpack/test/abstract/abstract_controller_test.rb index 62f82a4c7a..eb9143c8f6 100644 --- a/actionpack/test/abstract/abstract_controller_test.rb +++ b/actionpack/test/abstract/abstract_controller_test.rb @@ -157,13 +157,11 @@ module AbstractController private def self.layout(formats) + find_template(name.underscore, {:formats => formats}, :_prefixes => ["layouts"]) + rescue ActionView::MissingTemplate begin - find_template(name.underscore, {:formats => formats}, :_prefixes => ["layouts"]) + find_template("application", {:formats => formats}, :_prefixes => ["layouts"]) rescue ActionView::MissingTemplate - begin - find_template("application", {:formats => formats}, :_prefixes => ["layouts"]) - rescue ActionView::MissingTemplate - end end end diff --git a/actionpack/test/abstract/helper_test.rb b/actionpack/test/abstract/helper_test.rb index e79008fa9d..7960e5b55b 100644 --- a/actionpack/test/abstract/helper_test.rb +++ b/actionpack/test/abstract/helper_test.rb @@ -69,12 +69,10 @@ module AbstractController end def test_declare_missing_helper - begin - AbstractHelpers.helper :missing - flunk "should have raised an exception" - rescue LoadError => e - assert_equal "helpers/missing_helper.rb", e.path - end + AbstractHelpers.helper :missing + flunk "should have raised an exception" + rescue LoadError => e + assert_equal "helpers/missing_helper.rb", e.path end def test_helpers_with_module_through_block |