diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-11-30 21:26:52 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-11-30 21:26:52 +0100 |
commit | 1243255c3a36433041012b6107a5ac48658a0895 (patch) | |
tree | 04440f84b48999ff08d4a2a16d066d0ad731400e /spec/ruby/core/exception/source_encoding_name_spec.rb | |
parent | ab8345271eb87ff155d8bd5f22f53a4cf2902c26 (diff) |
Update to ruby/spec@4eec3dc
Diffstat (limited to 'spec/ruby/core/exception/source_encoding_name_spec.rb')
-rw-r--r-- | spec/ruby/core/exception/source_encoding_name_spec.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/ruby/core/exception/source_encoding_name_spec.rb b/spec/ruby/core/exception/source_encoding_name_spec.rb index bd8bc359b6..6f5dbd01aa 100644 --- a/spec/ruby/core/exception/source_encoding_name_spec.rb +++ b/spec/ruby/core/exception/source_encoding_name_spec.rb @@ -1,9 +1,23 @@ require_relative '../../spec_helper' describe "Encoding::UndefinedConversionError#source_encoding_name" do - it "needs to be reviewed for spec completeness" + it "returns the source encoding name" do + ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP") + begin + ec.convert("\xa0") + rescue Encoding::UndefinedConversionError => e + e.source_encoding_name.should == "UTF-8" + end + end end describe "Encoding::InvalidByteSequenceError#source_encoding_name" do - it "needs to be reviewed for spec completeness" + it "returns the source encoding name" do + ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1") + begin + ec.convert("\xa0") + rescue Encoding::InvalidByteSequenceError => e + e.source_encoding_name.should == "EUC-JP" + end + end end |