mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_m17n.rb (assert_warning): use common method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fbdce66908
commit
b30c4aa8d7
1 changed files with 1 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
require 'test/unit'
|
||||
require 'stringio'
|
||||
require_relative 'envutil'
|
||||
|
||||
class TestM17N < Test::Unit::TestCase
|
||||
def assert_encoding(encname, actual, message=nil)
|
||||
|
@ -23,17 +23,6 @@ class TestM17N < Test::Unit::TestCase
|
|||
assert_equal(a(bytes), a(actual), message)
|
||||
end
|
||||
|
||||
def assert_warning(pat, mesg=nil)
|
||||
begin
|
||||
org_stderr = $stderr
|
||||
$stderr = StringIO.new(warn = '')
|
||||
yield
|
||||
ensure
|
||||
$stderr = org_stderr
|
||||
end
|
||||
assert_match(pat, warn, mesg)
|
||||
end
|
||||
|
||||
def assert_regexp_generic_encoding(r)
|
||||
assert(!r.fixed_encoding?)
|
||||
%w[ASCII-8BIT EUC-JP Windows-31J UTF-8].each {|ename|
|
||||
|
|
Loading…
Add table
Reference in a new issue