Skip to content

Commit 57e7cd4

Browse files
committed
Suppress test warnings
1 parent 74281ff commit 57e7cd4

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

test/test_basic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_open_without_block
3535

3636
def test_open_with_block
3737
input = "#{EUCJ_STR}\n"*2
38-
output = ""
38+
output = String.new
3939
Iconv.open("Shift_JIS", "EUC-JP") do |cd|
4040
input.each_line do |s|
4141
output << cd.iconv(s)

test/test_option.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
require File.expand_path("../utils.rb", __FILE__)
22

33
class TestIconv::Option < TestIconv
4-
def test_ignore_option
4+
def setup
55
begin
66
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
77
iconv.transliterate?
88
rescue NotImplementedError
9-
return
9+
omit "Iconv option is not implemented"
1010
end
11+
@verbose, $VERBOSE = $VERBOSE, nil
12+
end
13+
14+
def teardown
15+
$VERBOSE = @verbose
16+
end
17+
18+
def test_ignore_option
1119
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
1220
str = iconv.iconv(EUCJ_STR)
1321
str << iconv.iconv(nil)
@@ -22,12 +30,6 @@ def test_ignore_option
2230
end
2331

2432
def test_translit_option
25-
begin
26-
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
27-
iconv.transliterate?
28-
rescue NotImplementedError
29-
return
30-
end
3133
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
3234
str = iconv.iconv(EUCJ_STR)
3335
str << iconv.iconv(nil)

test/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class TestIconv < ::Test::Unit::TestCase
55
if defined?(::Encoding) and String.method_defined?(:force_encoding)
66
def self.encode(str, enc)
7-
str.force_encoding(enc)
7+
str.dup.force_encoding(enc)
88
end
99
else
1010
def self.encode(str, enc)

0 commit comments

Comments
 (0)