aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-09 22:10:40 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-09 22:10:40 +0000
commitef57b93a82acab5a79620e405af5534cdf0e89c3 (patch)
tree7a309c0f0fcabd1f9ad45857d2f04258121d5d6a /activesupport/test
parent77de690a56b52909d45c300fd37b452c19fbb81e (diff)
downloadrails-ef57b93a82acab5a79620e405af5534cdf0e89c3.tar.gz
rails-ef57b93a82acab5a79620e405af5534cdf0e89c3.tar.bz2
rails-ef57b93a82acab5a79620e405af5534cdf0e89c3.zip
to_sentence returns self[0].to_s instead of just self[0] for arrays of length 1. Closes #10390 [Chu Yeow, mrj]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/array_ext_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb
index 5831e2a56a..d8ec45b62a 100644
--- a/activesupport/test/core_ext/array_ext_test.rb
+++ b/activesupport/test/core_ext/array_ext_test.rb
@@ -33,7 +33,6 @@ class ArrayExtToSentenceTests < Test::Unit::TestCase
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
@@ -57,6 +56,9 @@ class ArrayExtToSentenceTests < Test::Unit::TestCase
assert_equal "one", ['one'].to_sentence
end
+ def test_one_non_string_element
+ assert_equal '1', [1].to_sentence
+ end
end
class ArrayExtToSTests < Test::Unit::TestCase