aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-03-08 13:11:58 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-03-08 13:11:58 -0700
commit1c36172c13fc51b22167f5e8fc41b1da9f8fcb2a (patch)
treeeff2254dd84c81dda6db52b30286a2b5ad2cb525 /activesupport
parent0c407891fb209a4f94f09681db28e40a8b754198 (diff)
downloadrails-1c36172c13fc51b22167f5e8fc41b1da9f8fcb2a.tar.gz
rails-1c36172c13fc51b22167f5e8fc41b1da9f8fcb2a.tar.bz2
rails-1c36172c13fc51b22167f5e8fc41b1da9f8fcb2a.zip
Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.
[#1617 state:resolved]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb4
-rw-r--r--activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb26
-rw-r--r--activesupport/test/core_ext/class_test.rb6
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb4
-rw-r--r--activesupport/test/core_ext/load_error_test.rb4
-rw-r--r--activesupport/test/core_ext/module/synchronization_test.rb4
-rw-r--r--activesupport/test/core_ext/module_test.rb10
-rw-r--r--activesupport/test/core_ext/object_and_class_ext_test.rb4
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb2
-rw-r--r--activesupport/test/dependencies_test.rb22
-rw-r--r--activesupport/test/inflector_test.rb8
-rw-r--r--activesupport/test/json/decoding_test.rb2
-rw-r--r--activesupport/test/json/encoding_test.rb2
-rw-r--r--activesupport/test/message_encryptor_test.rb2
-rw-r--r--activesupport/test/message_verifier_test.rb2
-rw-r--r--activesupport/test/multibyte_chars_test.rb34
-rw-r--r--activesupport/test/string_inquirer_test.rb2
-rw-r--r--activesupport/test/time_zone_test.rb2
18 files changed, 70 insertions, 70 deletions
diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb b/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb
index bbb35ec809..50d6832c9e 100644
--- a/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb
@@ -116,10 +116,10 @@ class I18nTest < Test::Unit::TestCase
end
def test_localize_nil_raises_argument_error
- assert_raises(I18n::ArgumentError) { I18n.l nil }
+ assert_raise(I18n::ArgumentError) { I18n.l nil }
end
def test_localize_object_raises_argument_error
- assert_raises(I18n::ArgumentError) { I18n.l Object.new }
+ assert_raise(I18n::ArgumentError) { I18n.l Object.new }
end
end
diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb b/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
index 7b7b137579..65f3ac11a6 100644
--- a/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
@@ -155,7 +155,7 @@ class I18nSimpleBackendTranslateTest < Test::Unit::TestCase
end
def test_translate_given_an_array_of_inexistent_keys_it_raises_missing_translation_data
- assert_raises I18n::MissingTranslationData do
+ assert_raise I18n::MissingTranslationData do
@backend.translate('en', :does_not_exist, :scope => [:foo], :default => [:does_not_exist_2, :does_not_exist_3])
end
end
@@ -180,11 +180,11 @@ class I18nSimpleBackendTranslateTest < Test::Unit::TestCase
end
def test_translate_given_nil_as_a_locale_raises_an_argument_error
- assert_raises(I18n::InvalidLocale){ @backend.translate nil, :bar }
+ assert_raise(I18n::InvalidLocale){ @backend.translate nil, :bar }
end
def test_translate_with_a_bogus_key_and_no_default_raises_missing_translation_data
- assert_raises(I18n::MissingTranslationData){ @backend.translate 'de', :bogus }
+ assert_raise(I18n::MissingTranslationData){ @backend.translate 'de', :bogus }
end
end
@@ -230,15 +230,15 @@ class I18nSimpleBackendPluralizeTest < Test::Unit::TestCase
end
def test_interpolate_given_incomplete_pluralization_data_raises_invalid_pluralization_data
- assert_raises(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, {:one => 'bar'}, 2) }
+ assert_raise(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, {:one => 'bar'}, 2) }
end
# def test_interpolate_given_a_string_raises_invalid_pluralization_data
- # assert_raises(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, 'bar', 2) }
+ # assert_raise(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, 'bar', 2) }
# end
#
# def test_interpolate_given_an_array_raises_invalid_pluralization_data
- # assert_raises(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, ['bar'], 2) }
+ # assert_raise(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, ['bar'], 2) }
# end
end
@@ -267,13 +267,13 @@ class I18nSimpleBackendInterpolateTest < Test::Unit::TestCase
end
def test_interpolate_given_an_unicode_value_hash_into_a_non_unicode_multibyte_string_raises_encoding_compatibility_error
- assert_raises(Encoding::CompatibilityError) do
+ assert_raise(Encoding::CompatibilityError) do
@backend.send(:interpolate, nil, euc_jp('こんにちは、{{name}}さん!'), :name => 'ゆきひろ')
end
end
def test_interpolate_given_a_non_unicode_multibyte_value_hash_into_an_unicode_string_raises_encoding_compatibility_error
- assert_raises(Encoding::CompatibilityError) do
+ assert_raise(Encoding::CompatibilityError) do
@backend.send(:interpolate, nil, 'こんにちは、{{name}}さん!', :name => euc_jp('ゆきひろ'))
end
end
@@ -292,11 +292,11 @@ class I18nSimpleBackendInterpolateTest < Test::Unit::TestCase
end
def test_interpolate_given_an_empty_values_hash_raises_missing_interpolation_argument
- assert_raises(I18n::MissingInterpolationArgument) { @backend.send(:interpolate, nil, 'Hi {{name}}!', {}) }
+ assert_raise(I18n::MissingInterpolationArgument) { @backend.send(:interpolate, nil, 'Hi {{name}}!', {}) }
end
def test_interpolate_given_a_string_containing_a_reserved_key_raises_reserved_interpolation_key
- assert_raises(I18n::ReservedInterpolationKey) { @backend.send(:interpolate, nil, '{{default}}', {:default => nil}) }
+ assert_raise(I18n::ReservedInterpolationKey) { @backend.send(:interpolate, nil, '{{default}}', {:default => nil}) }
end
private
@@ -352,11 +352,11 @@ class I18nSimpleBackendLocalizeDateTest < Test::Unit::TestCase
end
def test_localize_nil_raises_argument_error
- assert_raises(I18n::ArgumentError) { @backend.localize 'de', nil }
+ assert_raise(I18n::ArgumentError) { @backend.localize 'de', nil }
end
def test_localize_object_raises_argument_error
- assert_raises(I18n::ArgumentError) { @backend.localize 'de', Object.new }
+ assert_raise(I18n::ArgumentError) { @backend.localize 'de', Object.new }
end
end
@@ -486,7 +486,7 @@ class I18nSimpleBackendLoadTranslationsTest < Test::Unit::TestCase
include I18nSimpleBackendTestSetup
def test_load_translations_with_unknown_file_type_raises_exception
- assert_raises(I18n::UnknownFileType) { @backend.load_translations "#{@locale_dir}/en.xml" }
+ assert_raise(I18n::UnknownFileType) { @backend.load_translations "#{@locale_dir}/en.xml" }
end
def test_load_translations_with_ruby_file_type_does_not_raise_exception
diff --git a/activesupport/test/core_ext/class_test.rb b/activesupport/test/core_ext/class_test.rb
index 9c6071d478..48d8a78acf 100644
--- a/activesupport/test/core_ext/class_test.rb
+++ b/activesupport/test/core_ext/class_test.rb
@@ -19,19 +19,19 @@ class ClassTest < Test::Unit::TestCase
def test_removing_class_in_root_namespace
assert A.is_a?(Class)
Class.remove_class(A)
- assert_raises(NameError) { A.is_a?(Class) }
+ assert_raise(NameError) { A.is_a?(Class) }
end
def test_removing_class_in_one_level_namespace
assert X::B.is_a?(Class)
Class.remove_class(X::B)
- assert_raises(NameError) { X::B.is_a?(Class) }
+ assert_raise(NameError) { X::B.is_a?(Class) }
end
def test_removing_class_in_two_level_namespace
assert Y::Z::C.is_a?(Class)
Class.remove_class(Y::Z::C)
- assert_raises(NameError) { Y::Z::C.is_a?(Class) }
+ assert_raise(NameError) { Y::Z::C.is_a?(Class) }
end
def test_retrieving_subclasses
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index b63ab30965..f1f1f15426 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -234,7 +234,7 @@ class HashExtTest < Test::Unit::TestCase
{ :failure => "stuff", :funny => "business" }.assert_valid_keys(:failure, :funny)
end
- assert_raises(ArgumentError, "Unknown key(s): failore") do
+ assert_raise(ArgumentError, "Unknown key(s): failore") do
{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
{ :failore => "stuff", :funny => "business" }.assert_valid_keys(:failure, :funny)
end
@@ -884,7 +884,7 @@ class QueryTest < Test::Unit::TestCase
end
def test_expansion_count_is_limited
- assert_raises RuntimeError do
+ assert_raise RuntimeError do
attack_xml = <<-EOT
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE member [
diff --git a/activesupport/test/core_ext/load_error_test.rb b/activesupport/test/core_ext/load_error_test.rb
index 5bb5b4d1b8..cfa8f978af 100644
--- a/activesupport/test/core_ext/load_error_test.rb
+++ b/activesupport/test/core_ext/load_error_test.rb
@@ -2,10 +2,10 @@ require 'abstract_unit'
class TestMissingSourceFile < Test::Unit::TestCase
def test_with_require
- assert_raises(MissingSourceFile) { require 'no_this_file_don\'t_exist' }
+ assert_raise(MissingSourceFile) { require 'no_this_file_don\'t_exist' }
end
def test_with_load
- assert_raises(MissingSourceFile) { load 'nor_does_this_one' }
+ assert_raise(MissingSourceFile) { load 'nor_does_this_one' }
end
def test_path
begin load 'nor/this/one.rb'
diff --git a/activesupport/test/core_ext/module/synchronization_test.rb b/activesupport/test/core_ext/module/synchronization_test.rb
index b1d4bc5e06..c28bc9b073 100644
--- a/activesupport/test/core_ext/module/synchronization_test.rb
+++ b/activesupport/test/core_ext/module/synchronization_test.rb
@@ -28,14 +28,14 @@ class SynchronizationTest < Test::Unit::TestCase
end
def test_synchronize_with_no_mutex_raises_an_argument_error
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
@target.synchronize :to_s
end
end
def test_double_synchronize_raises_an_argument_error
@target.synchronize :to_s, :with => :mutex
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
@target.synchronize :to_s, :with => :mutex
end
end
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb
index a5d98507ba..0d3d10f333 100644
--- a/activesupport/test/core_ext/module_test.rb
+++ b/activesupport/test/core_ext/module_test.rb
@@ -92,8 +92,8 @@ class ModuleTest < Test::Unit::TestCase
end
def test_missing_delegation_target
- assert_raises(ArgumentError) { eval($nowhere) }
- assert_raises(ArgumentError) { eval($noplace) }
+ assert_raise(ArgumentError) { eval($nowhere) }
+ assert_raise(ArgumentError) { eval($noplace) }
end
def test_delegation_prefix
@@ -141,7 +141,7 @@ class ModuleTest < Test::Unit::TestCase
def test_delegation_without_allow_nil_and_nil_value
david = Someone.new("David")
- assert_raises(NoMethodError) { david.street }
+ assert_raise(NoMethodError) { david.street }
end
def test_parent
@@ -314,7 +314,7 @@ class MethodAliasingTest < Test::Unit::TestCase
alias_method_chain :duck, :orange
end
- assert_raises NoMethodError do
+ assert_raise NoMethodError do
@instance.duck
end
@@ -330,7 +330,7 @@ class MethodAliasingTest < Test::Unit::TestCase
alias_method_chain :duck, :orange
end
- assert_raises NoMethodError do
+ assert_raise NoMethodError do
@instance.duck
end
diff --git a/activesupport/test/core_ext/object_and_class_ext_test.rb b/activesupport/test/core_ext/object_and_class_ext_test.rb
index 0bdbd14f33..b6515e05a0 100644
--- a/activesupport/test/core_ext/object_and_class_ext_test.rb
+++ b/activesupport/test/core_ext/object_and_class_ext_test.rb
@@ -109,7 +109,7 @@ end
class ObjectTests < Test::Unit::TestCase
def test_suppress_re_raises
- assert_raises(LoadError) { suppress(ArgumentError) {raise LoadError} }
+ assert_raise(LoadError) { suppress(ArgumentError) {raise LoadError} }
end
def test_suppress_supresses
suppress(ArgumentError) { raise ArgumentError }
@@ -256,7 +256,7 @@ class ObjectTryTest < Test::Unit::TestCase
def test_nonexisting_method
method = :undefined_method
assert !@string.respond_to?(method)
- assert_raises(NoMethodError) { @string.try(method) }
+ assert_raise(NoMethodError) { @string.try(method) }
end
def test_valid_method
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index 1de6a2ac2e..accfe51ed6 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -751,7 +751,7 @@ class TimeWithZoneMethodsForTimeAndDateTimeTest < Test::Unit::TestCase
def test_use_zone_with_exception_raised
Time.zone = 'Alaska'
- assert_raises RuntimeError do
+ assert_raise RuntimeError do
Time.use_zone('Hawaii') { raise RuntimeError }
end
assert_equal ActiveSupport::TimeZone['Alaska'], Time.zone
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index fe04b91f2b..a21f09403f 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -43,7 +43,7 @@ class DependenciesTest < Test::Unit::TestCase
end
def test_missing_dependency_raises_missing_source_file
- assert_raises(MissingSourceFile) { require_dependency("missing_service") }
+ assert_raise(MissingSourceFile) { require_dependency("missing_service") }
end
def test_missing_association_raises_nothing
@@ -136,10 +136,10 @@ class DependenciesTest < Test::Unit::TestCase
def test_non_existing_const_raises_name_error
with_loading 'autoloading_fixtures' do
- assert_raises(NameError) { DoesNotExist }
- assert_raises(NameError) { NoModule::DoesNotExist }
- assert_raises(NameError) { A::DoesNotExist }
- assert_raises(NameError) { A::B::DoesNotExist }
+ assert_raise(NameError) { DoesNotExist }
+ assert_raise(NameError) { NoModule::DoesNotExist }
+ assert_raise(NameError) { A::DoesNotExist }
+ assert_raise(NameError) { A::B::DoesNotExist }
end
end
@@ -206,8 +206,8 @@ class DependenciesTest < Test::Unit::TestCase
def failing_test_access_thru_and_upwards_fails
with_loading 'autoloading_fixtures' do
assert ! defined?(ModuleFolder)
- assert_raises(NameError) { ModuleFolder::Object }
- assert_raises(NameError) { ModuleFolder::NestedClass::Object }
+ assert_raise(NameError) { ModuleFolder::Object }
+ assert_raise(NameError) { ModuleFolder::NestedClass::Object }
Object.__send__ :remove_const, :ModuleFolder
end
end
@@ -382,7 +382,7 @@ class DependenciesTest < Test::Unit::TestCase
with_loading 'autoloading_fixtures' do
require_dependency '././counting_loader'
assert_equal 1, $counting_loaded_times
- assert_raises(ArgumentError) { ActiveSupport::Dependencies.load_missing_constant Object, :CountingLoader }
+ assert_raise(ArgumentError) { ActiveSupport::Dependencies.load_missing_constant Object, :CountingLoader }
assert_equal 1, $counting_loaded_times
end
end
@@ -421,7 +421,7 @@ class DependenciesTest < Test::Unit::TestCase
def test_nested_load_error_isnt_rescued
with_loading 'dependencies' do
- assert_raises(MissingSourceFile) do
+ assert_raise(MissingSourceFile) do
RequiresNonexistent1
end
end
@@ -494,7 +494,7 @@ class DependenciesTest < Test::Unit::TestCase
def test_unloadable_should_fail_with_anonymous_modules
with_loading 'autoloading_fixtures' do
m = Module.new
- assert_raises(ArgumentError) { m.unloadable }
+ assert_raise(ArgumentError) { m.unloadable }
end
end
@@ -584,7 +584,7 @@ class DependenciesTest < Test::Unit::TestCase
end
def test_new_constants_in_with_illegal_module_name_raises_correct_error
- assert_raises(NameError) do
+ assert_raise(NameError) do
ActiveSupport::Dependencies.new_constants_in("Illegal-Name") {}
end
end
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index d8c93dc9ae..948b6d9bb0 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -161,13 +161,13 @@ class InflectorTest < Test::Unit::TestCase
assert_nothing_raised { assert_equal Ace::Base::Case, ActiveSupport::Inflector.constantize("::Ace::Base::Case") }
assert_nothing_raised { assert_equal InflectorTest, ActiveSupport::Inflector.constantize("InflectorTest") }
assert_nothing_raised { assert_equal InflectorTest, ActiveSupport::Inflector.constantize("::InflectorTest") }
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("UnknownClass") }
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("An invalid string") }
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("InvalidClass\n") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("UnknownClass") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("An invalid string") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("InvalidClass\n") }
end
def test_constantize_does_lexical_lookup
- assert_raises(NameError) { ActiveSupport::Inflector.constantize("Ace::Base::InflectorTest") }
+ assert_raise(NameError) { ActiveSupport::Inflector.constantize("Ace::Base::InflectorTest") }
end
def test_ordinal
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb
index ebd46a851e..b88a00e584 100644
--- a/activesupport/test/json/decoding_test.rb
+++ b/activesupport/test/json/decoding_test.rb
@@ -40,6 +40,6 @@ class TestJSONDecoding < Test::Unit::TestCase
end
def test_failed_json_decoding
- assert_raises(ActiveSupport::JSON::ParseError) { ActiveSupport::JSON.decode(%({: 1})) }
+ assert_raise(ActiveSupport::JSON::ParseError) { ActiveSupport::JSON.decode(%({: 1})) }
end
end
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index 2c5b4d0378..7d2eedad61 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -75,7 +75,7 @@ class TestJSONEncoding < Test::Unit::TestCase
def test_exception_raised_when_encoding_circular_reference
a = [1]
a << a
- assert_raises(ActiveSupport::JSON::CircularReferenceError) { a.to_json }
+ assert_raise(ActiveSupport::JSON::CircularReferenceError) { a.to_json }
end
def test_hash_key_identifiers_are_always_quoted
diff --git a/activesupport/test/message_encryptor_test.rb b/activesupport/test/message_encryptor_test.rb
index c0b4a4658c..ed3461571a 100644
--- a/activesupport/test/message_encryptor_test.rb
+++ b/activesupport/test/message_encryptor_test.rb
@@ -33,7 +33,7 @@ class MessageEncryptorTest < Test::Unit::TestCase
private
def assert_not_decrypted(value)
- assert_raises(ActiveSupport::MessageEncryptor::InvalidMessage) do
+ assert_raise(ActiveSupport::MessageEncryptor::InvalidMessage) do
@encryptor.decrypt(value)
end
end
diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb
index 2190308856..57c4ce841e 100644
--- a/activesupport/test/message_verifier_test.rb
+++ b/activesupport/test/message_verifier_test.rb
@@ -18,7 +18,7 @@ class MessageVerifierTest < Test::Unit::TestCase
end
def assert_not_verified(message)
- assert_raises(ActiveSupport::MessageVerifier::InvalidSignature) do
+ assert_raise(ActiveSupport::MessageVerifier::InvalidSignature) do
@verifier.verify(message)
end
end
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb
index 0644dbe603..661b33cc57 100644
--- a/activesupport/test/multibyte_chars_test.rb
+++ b/activesupport/test/multibyte_chars_test.rb
@@ -26,7 +26,7 @@ class MultibyteCharsTest < Test::Unit::TestCase
assert_nothing_raised do
@chars.__method_for_multibyte_testing
end
- assert_raises NoMethodError do
+ assert_raise NoMethodError do
@chars.__unknown_method
end
end
@@ -71,7 +71,7 @@ class MultibyteCharsTest < Test::Unit::TestCase
end
def test_unpack_raises_encoding_error_on_broken_strings
- assert_raises(ActiveSupport::Multibyte::EncodingError) do
+ assert_raise(ActiveSupport::Multibyte::EncodingError) do
@proxy_class.u_unpack(BYTE_STRING)
end
end
@@ -209,8 +209,8 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
end
def test_insert_throws_index_error
- assert_raises(IndexError) { @chars.insert(-12, 'わ')}
- assert_raises(IndexError) { @chars.insert(12, 'わ') }
+ assert_raise(IndexError) { @chars.insert(-12, 'わ')}
+ assert_raise(IndexError) { @chars.insert(12, 'わ') }
end
def test_should_know_if_one_includes_the_other
@@ -222,7 +222,7 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
end
def test_include_raises_type_error_when_nil_is_passed
- assert_raises(TypeError) do
+ assert_raise(TypeError) do
@chars.include?(nil)
end
end
@@ -257,22 +257,22 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
def test_indexed_insert_should_raise_on_index_overflow
before = @chars.to_s
- assert_raises(IndexError) { @chars[10] = 'a' }
- assert_raises(IndexError) { @chars[10, 4] = 'a' }
- assert_raises(IndexError) { @chars[/ii/] = 'a' }
- assert_raises(IndexError) { @chars[/()/, 10] = 'a' }
+ assert_raise(IndexError) { @chars[10] = 'a' }
+ assert_raise(IndexError) { @chars[10, 4] = 'a' }
+ assert_raise(IndexError) { @chars[/ii/] = 'a' }
+ assert_raise(IndexError) { @chars[/()/, 10] = 'a' }
assert_equal before, @chars
end
def test_indexed_insert_should_raise_on_range_overflow
before = @chars.to_s
- assert_raises(RangeError) { @chars[10..12] = 'a' }
+ assert_raise(RangeError) { @chars[10..12] = 'a' }
assert_equal before, @chars
end
def test_rjust_should_raise_argument_errors_on_bad_arguments
- assert_raises(ArgumentError) { @chars.rjust(10, '') }
- assert_raises(ArgumentError) { @chars.rjust }
+ assert_raise(ArgumentError) { @chars.rjust(10, '') }
+ assert_raise(ArgumentError) { @chars.rjust }
end
def test_rjust_should_count_characters_instead_of_bytes
@@ -289,8 +289,8 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
end
def test_ljust_should_raise_argument_errors_on_bad_arguments
- assert_raises(ArgumentError) { @chars.ljust(10, '') }
- assert_raises(ArgumentError) { @chars.ljust }
+ assert_raise(ArgumentError) { @chars.ljust(10, '') }
+ assert_raise(ArgumentError) { @chars.ljust }
end
def test_ljust_should_count_characters_instead_of_bytes
@@ -307,8 +307,8 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
end
def test_center_should_raise_argument_errors_on_bad_arguments
- assert_raises(ArgumentError) { @chars.center(10, '') }
- assert_raises(ArgumentError) { @chars.center }
+ assert_raise(ArgumentError) { @chars.center(10, '') }
+ assert_raise(ArgumentError) { @chars.center }
end
def test_center_should_count_charactes_instead_of_bytes
@@ -440,7 +440,7 @@ class MultibyteCharsExtrasTest < Test::Unit::TestCase
if RUBY_VERSION >= '1.9'
def test_tidy_bytes_is_broken_on_1_9_0
- assert_raises(ArgumentError) do
+ assert_raise(ArgumentError) do
assert_equal_codepoints [0xfffd].pack('U'), chars("\xef\xbf\xbd").tidy_bytes
end
end
diff --git a/activesupport/test/string_inquirer_test.rb b/activesupport/test/string_inquirer_test.rb
index dda7850e6b..7f11f667df 100644
--- a/activesupport/test/string_inquirer_test.rb
+++ b/activesupport/test/string_inquirer_test.rb
@@ -10,6 +10,6 @@ class StringInquirerTest < Test::Unit::TestCase
end
def test_missing_question_mark
- assert_raises(NoMethodError) { ActiveSupport::StringInquirer.new("production").production }
+ assert_raise(NoMethodError) { ActiveSupport::StringInquirer.new("production").production }
end
end
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index 6dec6a8f34..b01f62460a 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -244,7 +244,7 @@ class TimeZoneTest < Test::Unit::TestCase
assert_nil ActiveSupport::TimeZone["bogus"]
assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone["Central Time (US & Canada)"]
assert_instance_of ActiveSupport::TimeZone, ActiveSupport::TimeZone[8]
- assert_raises(ArgumentError) { ActiveSupport::TimeZone[false] }
+ assert_raise(ArgumentError) { ActiveSupport::TimeZone[false] }
end
def test_new