aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorBaptiste Fontaine2014-05-01 01:10:51 +0200
committerAdam Vandenberg2014-05-02 19:50:27 -0700
commitb3f664c79ffc91080f3b92639ff47f7659ce76d2 (patch)
treef24f2a1d17a16a077171f1bea4beda7af9bf958b /Library/Homebrew/test
parent0070c12a9843f9d227473d5b219dc31ad92bfe88 (diff)
downloadhomebrew-b3f664c79ffc91080f3b92639ff47f7659ce76d2.tar.bz2
Fix for String#undent
Without it, String#undent would fail on unindented strings, e.g.: "foo".undent NoMethodError: undefined method `length' for nil:NilClass` Closes #28873. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_string.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_string.rb b/Library/Homebrew/test/test_string.rb
index 6f8692367..547e99c3d 100644
--- a/Library/Homebrew/test/test_string.rb
+++ b/Library/Homebrew/test/test_string.rb
@@ -10,4 +10,12 @@ class StringTest < Test::Unit::TestCase
EOS
assert undented == "hi\nmy friend over\nthere\n"
end
+
+ def test_undent_not_indented
+ undented = <<-EOS.undent
+hi
+I'm not indented
+ EOS
+ assert undented == "hi\nI'm not indented\n"
+ end
end