Sha256: aeecaae17efb645e953b329e1c424d5d19ffc6b17e6184babed90268393e6f80

Contents?: true

Size: 976 Bytes

Versions: 3

Compression:

Stored size: 976 Bytes

Contents

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

describe "Ordinalize" do
  [
   [1, "first"],
   [2, "second"],
   [3, "third"],
   [4, "fourth"],
   [5, "fifth"],
   [6, "sixth"],
   [7, "seventh"],
   [8, "eighth"],
   [9, "ninth"],
   [10, "tenth"],
   [11, "eleventh"],
   [12, "twelveth"],
   [13, "thirteenth"],
   [14, "fourteenth"],
   [15, "fifteenth"],
   [16, "sixteenth"],
   [17, "seventeenth"],
   [18, "eighteenth"],
   [19, "nineteenth"],
   [20, "twentieth"],
   [21, "twenty-first"],
   [22, "twenty-second"],
   [23, "twenty-third"],
   [24, "twenty-fourth"],
   [25, "twenty-fifth"],
   [26, "twenty-sixth"],
   [27, "twenty-seventh"],
   [28, "twenty-eighth"],
   [29, "twenty-ninth"],
   [1024, "one thousand and twenty-fourth"]
  ].each do |num, expected|
    it "#{num} should be #{expected}" do
      num.ordinalize.should eql(expected)
    end
  end
  
  it "alternative spelling" do
    1.ordinalise.should eql("first")
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
ordinalize-0.0.2 spec/ordinalize_spec.rb
ordinalize-0.0.1 spec/ordinalize_spec.rb
humanize-0.0.1 spec/ordinalize_spec.rb