summaryrefslogtreecommitdiff
path: root/spec/ruby/core/encoding/name_list_spec.rb
blob: 836381c4d8601e9fec2b1226a525fc43c7e0b465 (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.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