aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/encoding/converter/source_encoding_spec.rb
blob: acec01502d56d2ecdb2548671bce4030892e151f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require File.expand_path('../../../../spec_helper', __FILE__)

with_feature :encoding do
  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
end