aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_chars_test.rb
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/test/multibyte_chars_test.rb
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/test/multibyte_chars_test.rb')
-rw-r--r--activesupport/test/multibyte_chars_test.rb34
1 files changed, 17 insertions, 17 deletions
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