aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/array_ext_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/array_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/array_ext_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb
index 3b16c8d2b3..2ee86c8af9 100644
--- a/activesupport/test/core_ext/array_ext_test.rb
+++ b/activesupport/test/core_ext/array_ext_test.rb
@@ -12,3 +12,17 @@ class ArrayExtToParamTests < Test::Unit::TestCase
assert_equal '10/20', [10, 20].to_param
end
end
+
+class ArrayExtConversionTests < Test::Unit::TestCase
+ def test_plain_array_to_sentence
+ assert_equal "one, two, and three", ['one', 'two', 'three'].to_sentence
+ end
+
+ def test_to_sentence_with_connector
+ assert_equal "one, two, and also three", ['one', 'two', 'three'].to_sentence('and also')
+ end
+
+ def test_one_element
+ assert_equal "one", ['one'].to_sentence
+ end
+end