public void testPrintErrorWithStringBacktrace() throws Exception {
testPrintErrorWithBacktrace("\"abc\"");
}
private void testPrintErrorWithBacktrace(String backtrace) throws Exception {
RubyIO oldStderr = (RubyIO)runtime.getGlobalVariables().get("$stderr");
try {
ByteArrayOutputStream stderrOutput = new ByteArrayOutputStream();
RubyIO newStderr = new RubyIO(runtime, stderrOutput);
runtime.getGlobalVariables().set("$stderr", newStderr);
try {
eval("class MyError < StandardError ; def backtrace ; " + backtrace + " ; end ; end ; raise MyError.new ");
fail("Expected MyError to be raised");