rubinius/rubinius — Issue #1440: Encoding#find - Encoding.aliases is always empty
Author: frodriguezsanc
Created: 2011-12-03 20:23:28+00:00
State: open

Hi, i'm trying to resolve this spec:

before(:all) do
@encodings = Encoding.aliases.to_a.flatten.uniq
end

it "returns the corresponding Encoding object if given a valid encoding name" do
@encodings.each do |enc|
Encoding.find(enc).should be_an_instance_of(Encoding)
end
end

But @encodings is empty because the unless validation is always true
in that method (in encoding.rb).

def self.aliases
aliases = {}
Rubinius::Encoding::SymbolMap.each do |n, e|
aliases[n] = e.name unless n.to_s == e.name
end

aliases
end

Someone can help me to understand why? :(

Thanks!