diff options
author | David Cornu <davidjcornu@gmail.com> | 2015-03-23 14:43:18 -0400 |
---|---|---|
committer | David Cornu <davidjcornu@gmail.com> | 2015-03-23 15:47:37 -0400 |
commit | a64f3e419598bce0ce2eb9e41dcccb676edb02e2 (patch) | |
tree | 22f067fe3284dd874cd8b95f98ecc978d0d95fc1 /activesupport/test/core_ext | |
parent | 4a0f314d8a54c090e53400f84508a3118c0fe2b4 (diff) | |
download | rails-a64f3e419598bce0ce2eb9e41dcccb676edb02e2.tar.gz rails-a64f3e419598bce0ce2eb9e41dcccb676edb02e2.tar.bz2 rails-a64f3e419598bce0ce2eb9e41dcccb676edb02e2.zip |
Make sure Array#to_sentence always returns a String
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/array/conversions_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array/conversions_test.rb b/activesupport/test/core_ext/array/conversions_test.rb index 577b889410..507e13f968 100644 --- a/activesupport/test/core_ext/array/conversions_test.rb +++ b/activesupport/test/core_ext/array/conversions_test.rb @@ -60,6 +60,12 @@ class ToSentenceTest < ActiveSupport::TestCase assert_equal exception.message, "Unknown key: :passing. Valid keys are: :words_connector, :two_words_connector, :last_word_connector, :locale" end + + def test_always_returns_string + assert_instance_of String, [ActiveSupport::SafeBuffer.new('one')].to_sentence + assert_instance_of String, [ActiveSupport::SafeBuffer.new('one'), 'two'].to_sentence + assert_instance_of String, [ActiveSupport::SafeBuffer.new('one'), 'two', 'three'].to_sentence + end end class ToSTest < ActiveSupport::TestCase |