Sha256: 9d146b3021be2fff9ec984e049be350c85ad942bf50015cf668757058f2f5a4f

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

require 'dirge'
require ~'spec_helper'

describe Anybase, "from" do
  it "should translate to a number" do
    Anybase.new("012345678").to_i('2350').should == 1746
  end

  it "should raise an exception if any char isn't included" do
    proc { Anybase.new("012345678").to_i('a2350') }.should raise_error(Anybase::UnrecognizedCharacterError)
  end

  it "should fold case" do
    Anybase.new("012345678abcd", :ignore_case => true).to_i('a23D5d0AbBc').should == Anybase.new("012345678abcd", :ignore_case => true).to_i('A23d5D0aBbC')
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
anybase-0.0.5 spec/from_spec.rb
anybase-0.0.4 spec/from_spec.rb