blob: a9e6474974a037d956d4a81ac5aade7dae741e33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
require_relative '../../spec_helper'
describe "Encoding::UndefinedConversionError#destination_encoding_name" do
it "returns the destination encoding name" do
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
begin
ec.convert("\xa0")
rescue Encoding::UndefinedConversionError => e
e.destination_encoding_name.should == "EUC-JP"
end
end
end
describe "Encoding::InvalidByteSequenceError#destination_encoding_name" do
it "returns the destination encoding name" do
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("\xa0")
rescue Encoding::InvalidByteSequenceError => e
e.destination_encoding_name.should == "UTF-8"
end
end
end
|