Skip to content

Commit

Permalink
Merge pull request #176 from Duhemm/scalatestplus-junit
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg authored Aug 11, 2020
2 parents a787fe3 + 32d8f5b commit 1330dda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public JUnitComputer(ClassLoader testClassLoader, CustomRunners customRunners, S
testClassLoader.loadClass(runner)
);
} catch (ClassNotFoundException e) {
e.printStackTrace();
// ignore, since we'll fail to find at least one of the 2 `JUnitRunners`
// (it moved from `org.scalatest.junit` to `org.scalatestplus.junit` in 3.1)
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ public class PantsFramework extends JUnitFramework {
"org.scalatest.junit.JUnitRunner"
);

// In ScalaTest 3.1+, `JUnitRunner` moved to a different package.
private static final CustomFingerprint scalatestPlusJunitFingerprint = CustomFingerprint.of(
"org.scalatest.Suite",
"org.scalatestplus.junit.JUnitRunner"
);

private static final Fingerprint[] FINGERPRINTS = new Fingerprint[] {
new RunWithFingerprint(),
new JUnitFingerprint(),
new JUnit3Fingerprint(),
scalatestFingerprint
scalatestFingerprint,
scalatestPlusJunitFingerprint
};

@Override
Expand All @@ -26,7 +33,7 @@ public Fingerprint[] fingerprints() {

@Override
public CustomRunners customRunners() {
return CustomRunners.of(scalatestFingerprint);
return CustomRunners.of(scalatestFingerprint, scalatestPlusJunitFingerprint);
}

@Override
Expand Down

0 comments on commit 1330dda

Please sign in to comment.