Sha256: 09c7d481ab8abff9592f089563f79bf839d2a76789b2fedcdd1b1567989e3fc3

Contents?: true

Size: 1.53 KB

Versions: 12

Compression:

Stored size: 1.53 KB

Contents

describe Integer, "#words" do
  @seq = {
    0 => 'zero',
    1 => 'one',
    2 => 'two',
    3 => 'three',
    4 => 'four',
    5 => 'five',
    6 => 'six',
    7 => 'seven',
    8 => 'eight',
    9 => 'nine',
    10 => 'ten',
    11 => 'eleven',
    12 => 'twelve',
    13 => 'thirteen',
    14 => 'fourteen',
    15 => 'fifteen',
    16 => 'sixteen',
    17 => 'seventeen',
    18 => 'eighteen',
    19 => 'nineteen',
    20 => 'twenty',
    24 => 'twenty four',
    30 => 'thirty',
    39 => 'thirty nine',
    40 => 'forty',
    42 => 'forty two',
    50 => 'fifty',
    56 => 'fifty six',
    60 => 'sixty',
    63 => 'sixty three',
    70 => 'seventy',
    71 => 'seventy one',
    80 => 'eighty',
    88 => 'eighty eight',
    90 => 'ninety',
    95 => 'ninety five',
    100 => 'one hundred',
    103 => 'one hundred and three',
    140 => 'one hundred and forty',
    155 => 'one hundred and fifty five',
    199 => 'one hundred and ninety nine',
    300 => 'three hundred',
    712 => 'seven hundred and twelve',
    1_000 => 'one thousand',
    1_001 => 'one thousand and one',
    30_333 => 'thirty thousand, three hundred and thirty three',
    900_002 => 'nine hundred thousand and two',
    1_000_000 => 'one million',
    34_000_006 => 'thirty four million and six',
    999_999_999 => 'nine hundred and ninety nine million, nine hundred and ninety nine thousand, nine hundred and ninety nine',
    40_000_000_000 => 'forty billion',
  }.each_pair do |n, name|
    it "returns #{name} for #{n}" do
      n.words.should == name
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
numb-0.186.0 spec/numb/words_spec.rb
numb-0.185.0 spec/numb/words_spec.rb
numb-0.184.0 spec/numb/words_spec.rb
numb-0.181.0 spec/numb/words_spec.rb
numb-0.170.0 spec/numb/words_spec.rb
numb-0.152.0 spec/numb/words_spec.rb
numb-0.138.0 spec/numb/words_spec.rb
numb-0.125.0 spec/numb/words_spec.rb
numb-0.114.0 spec/numb/words_spec.rb
numb-0.111.0 spec/numb/words_spec.rb
numb-0.109.0 spec/numb/words_spec.rb
numb-0.99.0 spec/numb/words_spec.rb