summaryrefslogtreecommitdiff
path: root/spec/ruby/core/encoding/converter/source_encoding_spec.rb
blob: 6196f717bd15e30f4ae11fcf763d2a0c45c66ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
require_relative '../../../spec_helper'

describe "Encoding::Converter#source_encoding" do
  it "returns the source encoding as an Encoding object" do
    ec = Encoding::Converter.new('ASCII','Big5')
    ec.source_encoding.should == Encoding::US_ASCII

    ec = Encoding::Converter.new('Shift_JIS','EUC-JP')
    ec.source_encoding.should == Encoding::SHIFT_JIS
  end
end