extract undent test to test case

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Michael Morgan 2010-10-17 18:27:10 -04:00 committed by Adam Vandenberg
parent 599c7fe7d0
commit 3ea550100f
3 changed files with 16 additions and 10 deletions

View File

@ -3,13 +3,3 @@ class String
gsub /^.{#{slice(/^ +/).length}}/, '' gsub /^.{#{slice(/^ +/).length}}/, ''
end end
end end
if __FILE__ == $0
undented = <<-EOS.undent
hi
....my friend over
there
EOS
assert undented == "hi\nmy friend over\nthere\n"
end

View 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

View File

@ -15,3 +15,4 @@
/usr/bin/ruby test_ARGV.rb $* /usr/bin/ruby test_ARGV.rb $*
/usr/bin/ruby test_ENV.rb $* /usr/bin/ruby test_ENV.rb $*
/usr/bin/ruby test_updater.rb $* /usr/bin/ruby test_updater.rb $*
/usr/bin/ruby test_string.rb $*