diff options
| -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 $*  | 
