aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/array_ext_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-02 01:51:52 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-02 01:51:52 +0000
commit4c5db2c7eac5fc7fe76e0c0cd12d8adf5b7ea4f1 (patch)
tree1d5cfd2c12ab8143cc24c8bdc45200689f530cf8 /activesupport/test/core_ext/array_ext_test.rb
parent3574ab30596ad3313607927505aed115b740fc87 (diff)
downloadrails-4c5db2c7eac5fc7fe76e0c0cd12d8adf5b7ea4f1.tar.gz
rails-4c5db2c7eac5fc7fe76e0c0cd12d8adf5b7ea4f1.tar.bz2
rails-4c5db2c7eac5fc7fe76e0c0cd12d8adf5b7ea4f1.zip
Fixed that Array#to_sentence will return "" on an empty array instead of ", and" (closes #3842, #4031) [rubyonrails@beautifulpixel.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3739 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/array_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/array_ext_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb
index 9e23eed450..6a946064fc 100644
--- a/activesupport/test/core_ext/array_ext_test.rb
+++ b/activesupport/test/core_ext/array_ext_test.rb
@@ -15,7 +15,11 @@ end
class ArrayExtConversionTests < Test::Unit::TestCase
def test_plain_array_to_sentence
+ assert_equal "", [].to_sentence
+ assert_equal "one", ['one'].to_sentence
+ assert_equal "one and two", ['one', 'two'].to_sentence
assert_equal "one, two, and three", ['one', 'two', 'three'].to_sentence
+
end
def test_to_sentence_with_connector