From 27b8a9926310abe93110a7985031573fbd5845ab Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sun, 26 May 2013 18:47:23 +0200 Subject: [PATCH] add test-case for `Array#to_sentence with blank items. --- activesupport/test/core_ext/array_ext_test.rb | 4 ++++ 1 file changed, 4 insertions(+) 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