diff options
| author | Michael Morgan | 2010-10-17 18:27:10 -0400 |
|---|---|---|
| committer | Adam Vandenberg | 2010-10-17 21:13:16 -0700 |
| commit | 447fb2f6401bc642e3074efaeb664f8cb9338118 (patch) | |
| tree | 0df57cedfb427f928fb238202763cf45bd3f3c7f /Library | |
| parent | bb32c7e6885f11643c2255a1a97ae331a17339e3 (diff) | |
| download | homebrew-447fb2f6401bc642e3074efaeb664f8cb9338118.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 $* |
