Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_open_without_block

def test_open_with_block
input = "#{EUCJ_STR}\n"*2
output = ""
output = String.new
Iconv.open("Shift_JIS", "EUC-JP") do |cd|
input.each_line do |s|
output << cd.iconv(s)
Expand Down
18 changes: 10 additions & 8 deletions test/test_option.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
require File.expand_path("../utils.rb", __FILE__)

class TestIconv::Option < TestIconv
def test_ignore_option
def setup
begin
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
iconv.transliterate?
rescue NotImplementedError
return
omit "Iconv option is not implemented"
end
@verbose, $VERBOSE = $VERBOSE, nil
end

def teardown
$VERBOSE = @verbose
end

def test_ignore_option
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
str = iconv.iconv(EUCJ_STR)
str << iconv.iconv(nil)
Expand All @@ -22,12 +30,6 @@ def test_ignore_option
end

def test_translit_option
begin
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
iconv.transliterate?
rescue NotImplementedError
return
end
iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
str = iconv.iconv(EUCJ_STR)
str << iconv.iconv(nil)
Expand Down
2 changes: 1 addition & 1 deletion test/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class TestIconv < ::Test::Unit::TestCase
if defined?(::Encoding) and String.method_defined?(:force_encoding)
def self.encode(str, enc)
str.force_encoding(enc)
str.dup.force_encoding(enc)
end
else
def self.encode(str, enc)
Expand Down