diff options
author | Xavier Noria <fxn@hashref.com> | 2012-02-07 14:08:02 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-02-07 14:08:02 -0800 |
commit | 827b520bd1f946471105d9dd9593b9db56b0f6bc (patch) | |
tree | ef9b079ea4af43a655aedec75201623f96f2621b /activesupport/test | |
parent | 55cc16f502399b69051e4ff5432569bbea45e9c0 (diff) | |
parent | a470d796972749889a27e2070bbd95346bba45ea (diff) | |
download | rails-827b520bd1f946471105d9dd9593b9db56b0f6bc.tar.gz rails-827b520bd1f946471105d9dd9593b9db56b0f6bc.tar.bz2 rails-827b520bd1f946471105d9dd9593b9db56b0f6bc.zip |
Merge pull request #4878 from vijaydev/ordinal-2072
PR #2072 with docs
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/integer_ext_test.rb | 5 | ||||
-rw-r--r-- | activesupport/test/inflector_test.rb | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/integer_ext_test.rb b/activesupport/test/core_ext/integer_ext_test.rb index 7597f9c6f5..41736fb672 100644 --- a/activesupport/test/core_ext/integer_ext_test.rb +++ b/activesupport/test/core_ext/integer_ext_test.rb @@ -22,4 +22,9 @@ class IntegerExtTest < ActiveSupport::TestCase assert_equal '1st', 1.ordinalize assert_equal '8th', 8.ordinalize end + + def test_ordinal + assert_equal 'st', 1.ordinal + assert_equal 'th', 8.ordinal + end end diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 3311d58254..e7c671778a 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -304,6 +304,12 @@ class InflectorTest < ActiveSupport::TestCase def test_ordinal OrdinalNumbers.each do |number, ordinalized| + assert_equal(ordinalized, number + ActiveSupport::Inflector.ordinal(number)) + end + end + + def test_ordinalize + OrdinalNumbers.each do |number, ordinalized| assert_equal(ordinalized, ActiveSupport::Inflector.ordinalize(number)) end end |