Skip to content

Commit 84382f7

Browse files
committed
Fix TestRuby for new per-platform extensions.
1 parent 1774b6d commit 84382f7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/org/jruby/test/TestRuby.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,18 @@ public void testRequireCextNotAllowedWhenCextIsDisabledGlobally() throws Excepti
122122
RubyInstanceConfig cfg = new RubyInstanceConfig();
123123
cfg.setCextEnabled(false);
124124
runtime = Ruby.newInstance(cfg);
125+
126+
String extensionSuffix;
127+
if (Platform.IS_WINDOWS) {
128+
extensionSuffix = ".dll";
129+
} else if (Platform.IS_MAC) { // TODO: BSD also?
130+
extensionSuffix = ".bundle";
131+
} else {
132+
extensionSuffix = ".so";
133+
}
134+
125135
try {
126-
runtime.evalScriptlet("require 'tempfile'; file = Tempfile.open(['foo', '.so']); file.close; require file.path");
136+
runtime.evalScriptlet("require 'tempfile'; file = Tempfile.open(['foo', '" + extensionSuffix + "']); file.close; require file.path");
127137
fail();
128138
} catch (RaiseException re) {
129139
assertTrue(re.getException().message.asJavaString().startsWith(

0 commit comments

Comments
 (0)