2010-11-17 02:14:13 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require_relative 'ruby/envutil'
|
|
|
|
|
|
|
|
class TestTracer < Test::Unit::TestCase
|
|
|
|
include EnvUtil
|
|
|
|
|
|
|
|
def test_work_with_e
|
2011-01-13 21:02:12 -05:00
|
|
|
assert_in_out_err(%w[--disable-gems -rtracer -e 1]) do |(*lines),|
|
2010-11-17 02:14:13 -05:00
|
|
|
case lines.size
|
|
|
|
when 2
|
|
|
|
assert_match %r[#0:<internal:lib/rubygems/custom_require>:\d+:Kernel:<: -], lines[0]
|
|
|
|
when 1
|
|
|
|
# do nothing
|
|
|
|
else
|
2011-01-13 21:02:12 -05:00
|
|
|
flunk "unexpected output from `ruby -rtracer -e 1`"
|
2010-11-17 02:14:13 -05:00
|
|
|
end
|
2011-01-13 21:02:12 -05:00
|
|
|
assert_equal "#0:-e:1::-: 1", lines.last
|
2010-11-17 02:14:13 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|