diff options
| author | Michael Morgan | 2010-10-17 18:27:10 -0400 |
|---|---|---|
| committer | Adam Vandenberg | 2010-10-17 21:13:16 -0700 |
| commit | 3ea550100f948e307ecd67413089faf6b5057f20 (patch) | |
| tree | 945521832e23cf06667242bd4780774a63db3395 /Library | |
| parent | 599c7fe7d073028d853337f02a957c9e9140d120 (diff) | |
| download | brew-3ea550100f948e307ecd67413089faf6b5057f20.tar.bz2 | |
extract undent test to test case
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/string.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_string.rb | 15 | ||||
| -rwxr-xr-x | Library/Homebrew/test/tests | 1 |
3 files changed, 16 insertions, 10 deletions
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index 974906b1d..ddc5fdf7f 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -3,13 +3,3 @@ class String gsub /^.{#{slice(/^ +/).length}}/, '' end end - -if __FILE__ == $0 - undented = <<-EOS.undent - hi -....my friend over - there - EOS - - assert undented == "hi\nmy friend over\nthere\n" -end diff --git a/Library/Homebrew/test/test_string.rb b/Library/Homebrew/test/test_string.rb new file mode 100644 index 000000000..55a70f72c --- /dev/null +++ b/Library/Homebrew/test/test_string.rb @@ -0,0 +1,15 @@ +require 'testing_env' +require 'utils' + +require 'extend/string' + +class StringTest <Test::Unit::TestCase + def test_undent + undented = <<-EOS.undent + hi +....my friend over + there + EOS + assert undented == "hi\nmy friend over\nthere\n" + end +end diff --git a/Library/Homebrew/test/tests b/Library/Homebrew/test/tests index 87125decb..8d24ea435 100755 --- a/Library/Homebrew/test/tests +++ b/Library/Homebrew/test/tests @@ -15,3 +15,4 @@ /usr/bin/ruby test_ARGV.rb $* /usr/bin/ruby test_ENV.rb $* /usr/bin/ruby test_updater.rb $* +/usr/bin/ruby test_string.rb $* |
