summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-20 02:44:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-20 02:44:59 +0000
commit191c8d9e139d7e66d9bb5fc74a4dec2a7acbc6b4 (patch)
tree5f80667be36f32077c6d5c66bbee5822e20a7b22
parent3ba3f8a0c71d8d00a338c3a7f6293a48d587abf3 (diff)
test_enum.rb: use assert_warning
* test/ruby/test_enum.rb (test_slice_before): use assert_warning defined in test/lib/envutils.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_enum.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 0cb7e93c0a4..8b9a8c317ee 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -33,20 +33,6 @@ class TestEnumerable < Test::Unit::TestCase
$VERBOSE = @verbose
end
- def assert_not_warn
- begin
- org_stderr = $stderr
- v = $VERBOSE
- $stderr = StringIO.new(warn = '')
- $VERBOSE = true
- yield
- ensure
- $stderr = org_stderr
- $VERBOSE = v
- end
- assert_equal("", warn)
- end
-
def test_grep
assert_equal([1, 2, 1, 2], @obj.grep(1..2))
a = []
@@ -513,7 +499,7 @@ class TestEnumerable < Test::Unit::TestCase
ss = %w[abc defg h ijk l mno pqr st u vw xy z]
assert_equal([%w[abc defg h], %w[ijk l], %w[mno], %w[pqr st u vw xy z]],
ss.slice_before(/\A...\z/).to_a)
- assert_not_warn{ss.slice_before(/\A...\z/).to_a}
+ assert_warning("") {ss.slice_before(/\A...\z/).to_a}
end
def test_slice_after0