Skip to content

Commit

Permalink
Update this test to match master to remove the printStacktrace (and p…
Browse files Browse the repository at this point in the history
…resumably make this pass on windows)
  • Loading branch information
enebo committed Sep 7, 2012
1 parent 45af2c6 commit cc93dab
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/org/jruby/test/TestRuby.java
Expand Up @@ -132,12 +132,21 @@ public void testRequireCextNotAllowedWhenCextIsDisabledGlobally() throws Excepti
cfg.setCextEnabled(false);
runtime = Ruby.newInstance(cfg);

String extensionSuffix;
if (Platform.IS_WINDOWS) {
extensionSuffix = ".dll";
} else if (Platform.IS_MAC) { // TODO: BSD also?
extensionSuffix = ".bundle";
} else {
extensionSuffix = ".so";
}

try {
runtime.evalScriptlet("require 'tempfile'; file = Tempfile.open(['foo', '.so']); file.close; require file.path");
runtime.evalScriptlet("require 'tempfile'; file = Tempfile.open(['foo', '" + extensionSuffix + "']); file.close; require file.path");
fail();
} catch (RaiseException re) {
re.printStackTrace();
assertTrue(re.getException().message.asJavaString().startsWith("C extensions are disabled"));
assertTrue(re.getException().message.asJavaString().startsWith(
"C extensions are disabled"));
}
}

Expand Down

0 comments on commit cc93dab

Please sign in to comment.