Sha256: cda2aa483a335a48a7e8dd03e016eac99e087fce0846d6a9860968d67b9303ad

Contents?: true

Size: 553 Bytes

Versions: 40

Compression:

Stored size: 553 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Base62 encoding/decoding" do
  [
    [        1,     "1"],
    [       10,     "a"],
    [       61,     "Z"],
    [       62,    "10"],
    [       63,    "11"],
    [      124,    "20"],
    [200000000, "dxb8s"]
  ].each do |input, output|
    it "should encode #{input} correctly to #{output}" do
      Firefly::Base62.encode(input).should eql(output)
    end

    it "should decode correctly" do
      Firefly::Base62.decode(output).should eql(input)
    end
  end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
tmin-0.2.6 spec/firefly/base62_spec.rb
tmin-0.2.5 spec/firefly/base62_spec.rb
tmin-0.2.4 spec/firefly/base62_spec.rb
tmin-0.2.3 spec/firefly/base62_spec.rb
tmin-0.2.2 spec/firefly/base62_spec.rb
tmin-0.2.1 spec/firefly/base62_spec.rb
tmin-0.2.0 spec/firefly/base62_spec.rb
tmin-0.1.9 spec/firefly/base62_spec.rb
tmin-0.1.8 spec/firefly/base62_spec.rb
tmin-0.1.7 spec/firefly/base62_spec.rb
tg-firefly-0.9.0 spec/firefly/base62_spec.rb
tmin-0.1.6 spec/firefly/base62_spec.rb
tmin_test-0.0.5 spec/firefly/base62_spec.rb
tmin_test-0.0.4 spec/firefly/base62_spec.rb
tmin_test-0.0.3 spec/firefly/base62_spec.rb
tmin_test-0.0.2 spec/firefly/base62_spec.rb
tmin_test-0.0.1 spec/firefly/base62_spec.rb
tmin-0.1.5 spec/firefly/base62_spec.rb
tmin-0.1.4 spec/firefly/base62_spec.rb
tmin-0.1.3 spec/firefly/base62_spec.rb