2013-10-16 21:10:35 -04:00
|
|
|
require 'test/unit'
|
2013-11-26 19:32:37 -05:00
|
|
|
require 'tmpdir'
|
2013-10-16 21:10:35 -04:00
|
|
|
require_relative "../../ruby/envutil"
|
|
|
|
|
|
|
|
class TestBugReporter < Test::Unit::TestCase
|
|
|
|
def test_bug_reporter_add
|
|
|
|
expected_stderr = /Sample bug reporter: 12345/
|
2013-11-26 19:32:37 -05:00
|
|
|
tmpdir = Dir.mktmpdir
|
|
|
|
assert_in_out_err(["--disable-gems", "-r-test-/bug_reporter/bug_reporter",
|
|
|
|
"-C", tmpdir],
|
|
|
|
"register_sample_bug_reporter(12345); Process.kill :SEGV, $$",
|
|
|
|
[],
|
|
|
|
expected_stderr, nil)
|
|
|
|
ensure
|
|
|
|
FileUtils.rm_rf(tmpdir) if tmpdir
|
2013-10-16 21:10:35 -04:00
|
|
|
end
|
|
|
|
end
|