From 1c36172c13fc51b22167f5e8fc41b1da9f8fcb2a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 8 Mar 2009 13:11:58 -0700 Subject: Ruby 1.9 compat: rename deprecated assert_raises to assert_raise. [#1617 state:resolved] --- railties/guides/source/testing.textile | 2 +- railties/test/initializer_test.rb | 2 +- railties/test/plugin_locator_test.rb | 2 +- railties/test/plugin_test.rb | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index 9b764806a8..9897fbab6f 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -396,7 +396,7 @@ There are a bunch of different types of assertions you can use. Here's the compl |+assert_no_match( regexp, string, [msg] )+ |Ensures that a string doesn't matches the regular expression.| |+assert_in_delta( expecting, actual, delta, [msg] )+ |Ensures that the numbers +expecting+ and +actual+ are within +delta+ of each other.| |+assert_throws( symbol, [msg] ) { block }+ |Ensures that the given block throws the symbol.| -|+assert_raises( exception1, exception2, ... ) { block }+ |Ensures that the given block raises one of the given exceptions.| +|+assert_raise( exception1, exception2, ... ) { block }+ |Ensures that the given block raises one of the given exceptions.| |+assert_nothing_raised( exception1, exception2, ... ) { block }+ |Ensures that the given block doesn't raise one of the given exceptions.| |+assert_instance_of( class, obj, [msg] )+ |Ensures that +obj+ is of the +class+ type.| |+assert_kind_of( class, obj, [msg] )+ |Ensures that +obj+ is or descends from +class+.| diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb index e91e05d939..561f7b8b54 100644 --- a/railties/test/initializer_test.rb +++ b/railties/test/initializer_test.rb @@ -237,7 +237,7 @@ class InitializerPluginLoadingTests < Test::Unit::TestCase def test_registering_a_plugin_name_that_does_not_exist_raises_a_load_error only_load_the_following_plugins! [:stubby, :acts_as_a_non_existant_plugin] - assert_raises(LoadError) do + assert_raise(LoadError) do load_plugins! end end diff --git a/railties/test/plugin_locator_test.rb b/railties/test/plugin_locator_test.rb index c8404e126e..471d9fc7c3 100644 --- a/railties/test/plugin_locator_test.rb +++ b/railties/test/plugin_locator_test.rb @@ -2,7 +2,7 @@ require 'plugin_test_helper' class PluginLocatorTest < Test::Unit::TestCase def test_should_require_subclasses_to_implement_the_plugins_method - assert_raises(RuntimeError) do + assert_raise(RuntimeError) do Rails::Plugin::Locator.new(nil).plugins end end diff --git a/railties/test/plugin_test.rb b/railties/test/plugin_test.rb index 5500711df8..a6c390a45a 100644 --- a/railties/test/plugin_test.rb +++ b/railties/test/plugin_test.rb @@ -52,11 +52,11 @@ class PluginTest < Test::Unit::TestCase plugin_for(@valid_plugin_path).load_paths end - assert_raises(LoadError) do + assert_raise(LoadError) do plugin_for(@empty_plugin_path).load_paths end - assert_raises(LoadError) do + assert_raise(LoadError) do plugin_for('this_is_not_a_plugin_directory').load_paths end end @@ -77,13 +77,13 @@ class PluginTest < Test::Unit::TestCase end # This is an empty path so it raises - assert_raises(LoadError) do + assert_raise(LoadError) do plugin = plugin_for(@empty_plugin_path) plugin.stubs(:evaluate_init_rb) plugin.send(:load, @initializer) end - assert_raises(LoadError) do + assert_raise(LoadError) do plugin = plugin_for('this_is_not_a_plugin_directory') plugin.stubs(:evaluate_init_rb) plugin.send(:load, @initializer) @@ -97,11 +97,11 @@ class PluginTest < Test::Unit::TestCase end # This is an empty path so it raises - assert_raises(LoadError) do + assert_raise(LoadError) do plugin_for(@empty_plugin_path).load_paths end - assert_raises(LoadError) do + assert_raise(LoadError) do plugin_for('this_is_not_a_plugin_directory').load_paths end end -- cgit v1.2.3