diff options
| author | Baptiste Fontaine | 2014-05-01 01:10:51 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2014-05-02 19:50:27 -0700 |
| commit | 74e4fdfce2e7a2b927c259bf9f977dd6e97643c2 (patch) | |
| tree | 513c455567db2fab6baccd2072baaf25bcaa2070 /Library/Homebrew/test | |
| parent | 348d0eb05c9d6482d910ccf0bc0817f872059aef (diff) | |
| download | brew-74e4fdfce2e7a2b927c259bf9f977dd6e97643c2.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 Homebrew/homebrew#28873.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_string.rb | 8 |
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 |
