aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/string_ext_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-30 10:24:02 +0200
committerXavier Noria <fxn@hashref.com>2010-08-30 10:39:34 +0200
commitb422cda2ebfff4032f4c18271e96ad329c413dcc (patch)
tree0ce68f16f7d9b513cfcb0ba1ba56685c7aca849b /activesupport/test/core_ext/string_ext_test.rb
parent58d0e2c23c0c5578f23a4f4c639db5c0009b80c2 (diff)
downloadrails-b422cda2ebfff4032f4c18271e96ad329c413dcc.tar.gz
rails-b422cda2ebfff4032f4c18271e96ad329c413dcc.tar.bz2
rails-b422cda2ebfff4032f4c18271e96ad329c413dcc.zip
let String#strip_heredoc handle blank lines even if they are not indented
Diffstat (limited to 'activesupport/test/core_ext/string_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index d64706ee10..8be65c99f2 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -33,6 +33,15 @@ class StringInflectionsTest < Test::Unit::TestCase
EOS
end
+ def test_strip_heredoc_on_a_regular_indented_heredoc_with_blank_lines
+ assert_equal "foo\n bar\n\nbaz\n", <<-EOS.strip_heredoc
+ foo
+ bar
+
+ baz
+ EOS
+ end
+
def test_pluralize
SingularToPlural.each do |singular, plural|
assert_equal(plural, singular.pluralize)