Skip to content

Commit

Permalink
Wrap docstrings in Scala sources
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Sep 14, 2021
1 parent f47f933 commit adf2c4f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
5 changes: 3 additions & 2 deletions scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
trailingCommas = multiple
rewrite.rules = [ExpandImportSelectors, SortModifiers]
docstrings.wrap = yes
newlines.avoidForSimpleOverflow = [tooLong]
rewrite.rules = [ExpandImportSelectors, SortModifiers]
trailingCommas = multiple
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ trait TestWithEachProvider extends Matchers {
testSetupFun: (String => (=> Any) => Unit) => Any,
): Any = {

/**
* Wrapper around the standard [[FunSpec#it]] that sets the JCA [[Security]] providers before running the test,
* and then resets the providers to the original state after the test.
/** Wrapper around the standard [[FunSpec#it]] that sets the JCA
* [[Security]] providers before running the test, and then resets the
* providers to the original state after the test.
*
* This is needed because ScalaTest shared tests work by taking fixture parameters as lexical context,
* but JCA providers are set in the dynamic context.
* The [[FunSpec#it]] call does not immediately run the test, instead it registers a test to be run later.
* This helper ensures that the dynamic context matches the lexical context at the time the test runs.
* This is needed because ScalaTest shared tests work by taking fixture
* parameters as lexical context, but JCA providers are set in the dynamic
* context. The [[FunSpec#it]] call does not immediately run the test,
* instead it registers a test to be run later. This helper ensures that
* the dynamic context matches the lexical context at the time the test
* runs.
*/
def it(testName: String)(testFun: => Any): Unit = {
this.it.apply(testName) {
Expand Down Expand Up @@ -51,18 +53,18 @@ trait TestWithEachProvider extends Matchers {
}
}

/**
* Register tests in a modified DSL environment where the `it` "keyword"
* is modified to set the JCA [[Security]] providers before running the test,
/** Register tests in a modified DSL environment where the `it` "keyword" is
* modified to set the JCA [[Security]] providers before running the test,
* and then reset the providers to the original state after the test.
*
* The caller SHOULD name the callback parameter `it`,
* in order to shadow the standard [[FunSpec#it]] from ScalaTest.
* The caller SHOULD name the callback parameter `it`, in order to shadow the
* standard [[FunSpec#it]] from ScalaTest.
*
* This is needed because ScalaTest shared tests work by taking fixture parameters as lexical context,
* but JCA providers are set in the dynamic context.
* The [[FunSpec#it]] call does not immediately run the test, instead it registers a test to be run later.
* This helper ensures that the dynamic context matches the lexical context at the time the test runs.
* This is needed because ScalaTest shared tests work by taking fixture
* parameters as lexical context, but JCA providers are set in the dynamic
* context. The [[FunSpec#it]] call does not immediately run the test,
* instead it registers a test to be run later. This helper ensures that the
* dynamic context matches the lexical context at the time the test runs.
*/
def testWithEachProvider(
registerTests: (String => (=> Any) => Unit) => Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import java.security.interfaces.ECPublicKey
import java.security.interfaces.RSAPublicKey
import java.security.spec.PKCS8EncodedKeySpec

/**
* Re-exports from [[WebAuthnCodecs]] and [[Crypto]] so tests can use it
/** Re-exports from [[WebAuthnCodecs]] and [[Crypto]] so tests can use it
*/
object WebAuthnTestCodecs {

Expand Down

0 comments on commit adf2c4f

Please sign in to comment.