aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/encoding/name_list_spec.rb
blob: 6e02347bfd41c9cfdbd42aa905903dc7e7cb6332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require_relative '../../spec_helper'

with_feature :encoding do
  describe "Encoding.name_list" do
    it "returns an Array" do
      Encoding.name_list.should be_an_instance_of(Array)
    end

    it "returns encoding names as Strings" do
      Encoding.name_list.each {|e| e.should be_an_instance_of(String) }
    end

    it "includes all aliases" do
      Encoding.aliases.keys.each do |enc_alias|
        Encoding.name_list.include?(enc_alias).should be_true
      end
    end

    it "includes all non-dummy encodings" do
      Encoding.list.each do |enc|
        Encoding.name_list.include?(enc.name).should be_true
      end
    end
  end
end