diff options
Diffstat (limited to 'activesupport/test')
20 files changed, 133 insertions, 63 deletions
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..2285d5a724 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,8 @@ class QueryTest < Test::Unit::TestCase end def test_expansion_count_is_limited - assert_raises RuntimeError do + expected = defined?(LibXML) ? LibXML::XML::Error : RuntimeError + assert_raise expected 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/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index e232bf8384..6c9b7e7236 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -77,6 +77,24 @@ class StringInflectionsTest < Test::Unit::TestCase end end + def test_string_parameterized_normal + StringToParameterized.each do |normal, slugged| + assert_equal(normal.parameterize, slugged) + end + end + + def test_string_parameterized_no_separator + StringToParameterizeWithNoSeparator.each do |normal, slugged| + assert_equal(normal.parameterize(''), slugged) + end + end + + def test_string_parameterized_underscore + StringToParameterizeWithUnderscore.each do |normal, slugged| + assert_equal(normal.parameterize('_'), slugged) + end + end + def test_humanize UnderscoreToHuman.each do |underscore, human| assert_equal(human, underscore.humanize) 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/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb index b7ac467c37..584cbff3e7 100644 --- a/activesupport/test/inflector_test_cases.rb +++ b/activesupport/test/inflector_test_cases.rb @@ -154,6 +154,22 @@ module InflectorTestCases "Squeeze separators" => "squeeze-separators" } + StringToParameterizeWithNoSeparator = { + "Donald E. Knuth" => "donaldeknuth", + "Random text with *(bad)* characters" => "randomtextwithbadcharacters", + "Trailing bad characters!@#" => "trailingbadcharacters", + "!@#Leading bad characters" => "leadingbadcharacters", + "Squeeze separators" => "squeezeseparators" + } + + StringToParameterizeWithUnderscore = { + "Donald E. Knuth" => "donald_e_knuth", + "Random text with *(bad)* characters" => "random_text_with_bad_characters", + "Trailing bad characters!@#" => "trailing_bad_characters", + "!@#Leading bad characters" => "leading_bad_characters", + "Squeeze separators" => "squeeze_separators" + } + # Ruby 1.9 doesn't do Unicode normalization yet. if RUBY_VERSION >= '1.9' StringToParameterizedAndNormalized = { 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/memoizable_test.rb b/activesupport/test/memoizable_test.rb index 069ae27eb2..39420c5a3a 100644 --- a/activesupport/test/memoizable_test.rb +++ b/activesupport/test/memoizable_test.rb @@ -4,10 +4,12 @@ class MemoizableTest < Test::Unit::TestCase class Person extend ActiveSupport::Memoizable - attr_reader :name_calls, :age_calls + attr_reader :name_calls, :age_calls, :is_developer_calls + def initialize @name_calls = 0 @age_calls = 0 + @is_developer_calls = 0 end def name @@ -31,6 +33,14 @@ class MemoizableTest < Test::Unit::TestCase end memoize :name, :age + + private + + def is_developer? + @is_developer_calls += 1 + "Yes" + end + memoize :is_developer? end class Company @@ -223,4 +233,15 @@ class MemoizableTest < Test::Unit::TestCase company.memoize :name assert_raise(RuntimeError) { company.memoize :name } end + + def test_private_method_memoization + person = Person.new + + assert_raise(NoMethodError) { person.is_developer? } + assert_equal "Yes", person.send(:is_developer?) + assert_equal 1, person.is_developer_calls + assert_equal "Yes", person.send(:is_developer?) + assert_equal 1, person.is_developer_calls + end + end 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 067c461837..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 @@ -123,7 +123,6 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase [:rstrip!, :lstrip!, :strip!, :reverse!, :upcase!, :downcase!, :capitalize!].each do |method| assert_equal @chars.object_id, @chars.send(method).object_id end - assert_equal @chars.object_id, @chars.slice!(1).object_id end def test_overridden_bang_methods_change_wrapped_string @@ -133,10 +132,6 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase proxy.send(method) assert_not_equal original, proxy.to_s end - proxy = chars('Café') - proxy.slice!(3) - assert_equal 'é', proxy.to_s - proxy = chars('òu') proxy.capitalize! assert_equal 'Òu', proxy.to_s @@ -214,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 @@ -227,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 @@ -262,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 @@ -294,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 @@ -312,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 @@ -391,6 +386,15 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase assert_equal nil, @chars.slice(7..6) end + def test_slice_bang_returns_sliced_out_substring + assert_equal 'にち', @chars.slice!(1..2) + end + + def test_slice_bang_removes_the_slice_from_the_receiver + @chars.slice!(1..2) + assert_equal 'こわ', @chars + end + def test_slice_should_throw_exceptions_on_invalid_arguments assert_raise(TypeError) { @chars.slice(2..3, 1) } assert_raise(TypeError) { @chars.slice(1, 2..3) } @@ -436,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/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index fb76ca1ab6..7cd8c8a8f4 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -4,9 +4,11 @@ class OrderedHashTest < Test::Unit::TestCase def setup @keys = %w( blue green red pink orange ) @values = %w( 000099 009900 aa0000 cc0066 cc6633 ) + @hash = Hash.new @ordered_hash = ActiveSupport::OrderedHash.new @keys.each_with_index do |key, index| + @hash[key] = @values[index] @ordered_hash[key] = @values[index] end end @@ -17,7 +19,7 @@ class OrderedHashTest < Test::Unit::TestCase end def test_access - assert @keys.zip(@values).all? { |k, v| @ordered_hash[k] == v } + assert @hash.all? { |k, v| @ordered_hash[k] == v } end def test_assignment @@ -45,6 +47,10 @@ class OrderedHashTest < Test::Unit::TestCase assert_nil @ordered_hash.delete(bad_key) end + def test_to_hash + assert_same @ordered_hash, @ordered_hash.to_hash + end + def test_has_key assert_equal true, @ordered_hash.has_key?('blue') assert_equal true, @ordered_hash.key?('blue') @@ -148,4 +154,8 @@ class OrderedHashTest < Test::Unit::TestCase @ordered_hash.keys.pop assert_equal original, @ordered_hash.keys end -end
\ No newline at end of file + + def test_inspect + assert @ordered_hash.inspect.include?(@hash.inspect) + 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 |