diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb index 0d5f58a9be..4cef0120d6 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -13,7 +13,7 @@ class ArrayExtToParamTests < Test::Unit::TestCase end end -class ArrayExtConversionTests < Test::Unit::TestCase +class ArrayExtToSentenceTests < Test::Unit::TestCase def test_plain_array_to_sentence assert_equal "", [].to_sentence assert_equal "one", ['one'].to_sentence @@ -39,6 +39,19 @@ class ArrayExtConversionTests < Test::Unit::TestCase end end +class ArrayExtToSTests < Test::Unit::TestCase + def test_to_s_db + collection = [ + Class.new { def id() 1 end }.new, + Class.new { def id() 2 end }.new, + Class.new { def id() 3 end }.new + ] + + assert_equal "null", [].to_s(:db) + assert_equal "1,2,3", collection.to_s(:db) + end +end + class ArrayExtGroupingTests < Test::Unit::TestCase def test_group_by_with_perfect_fit groups = [] |