diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/integer_ext_test.rb | 6 | ||||
-rw-r--r-- | activesupport/test/inflector_test.rb | 6 |
2 files changed, 12 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..f01629f5c7 100644 --- a/activesupport/test/core_ext/integer_ext_test.rb +++ b/activesupport/test/core_ext/integer_ext_test.rb @@ -22,4 +22,10 @@ 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 + 1000000000000000000000000000000000000000000000000000000000000000000000.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 |