diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-05-26 18:47:23 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-05-26 18:47:23 +0200 |
commit | 27b8a9926310abe93110a7985031573fbd5845ab (patch) | |
tree | 464e9b844dd718d32dd6cd418b8525a48f27f2f2 | |
parent | ab28bafc9f1118652f5090fa1260923118930518 (diff) | |
download | rails-27b8a9926310abe93110a7985031573fbd5845ab.tar.gz rails-27b8a9926310abe93110a7985031573fbd5845ab.tar.bz2 rails-27b8a9926310abe93110a7985031573fbd5845ab.zip |
add test-case for `Array#to_sentence with blank items.
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 4 |
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 efa7582ab0..384064d81f 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -96,6 +96,10 @@ class ArrayExtToSentenceTests < ActiveSupport::TestCase assert_equal "one two, and three", ['one', 'two', 'three'].to_sentence(options) assert_equal({ words_connector: ' ' }, options) end + + def test_with_blank_elements + assert_equal ", one, , two, and three", [nil, 'one', '', 'two', 'three'].to_sentence + end end class ArrayExtToSTests < ActiveSupport::TestCase |