Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add ordinalize to Fixnum and Bignum instances

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit dba6b8b46f93ed0116755bea17cfbce7ca6d7c72 1 parent 305a546
@seckar seckar authored
View
3  activesupport/lib/active_support/core_ext/fixnum.rb
@@ -1,9 +1,12 @@
require File.dirname(__FILE__) + '/fixnum/even_odd'
+require File.dirname(__FILE__) + '/fixnum/inflections'
class Fixnum #:nodoc:
include ActiveSupport::CoreExtensions::Fixnum::EvenOdd
+ include ActiveSupport::CoreExtensions::Fixnum::Inflections
end
class Bignum #:nodoc:
include ActiveSupport::CoreExtensions::Fixnum::EvenOdd
+ include ActiveSupport::CoreExtensions::Fixnum::Inflections
end
View
7 activesupport/test/core_ext/fixnum_ext_test.rb
@@ -26,4 +26,11 @@ def test_multiple_of
assert !22953686867719691230002707821868552601124472329079.multiple_of?(5)
assert !22953686867719691230002707821868552601124472329079.multiple_of?(7)
end
+
+ def test_ordinalize
+ # These tests are mostly just to ensure that the ordinalize method exists
+ # It's results are tested comprehensively in the inflector test cases.
+ assert_equal '1st', 1.ordinalize
+ assert_equal '8th', 8.ordinalize
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.