extract undent test to test case
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
599c7fe7d0
commit
3ea550100f
@ -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
|
||||
|
15
Library/Homebrew/test/test_string.rb
Normal file
15
Library/Homebrew/test/test_string.rb
Normal file
@ -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
|
@ -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 $*
|
||||
|
Loading…
x
Reference in New Issue
Block a user