-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Locate test cases closer to code they test
* Add CommandsTest in commands and test the commands it defines * Add OnChangeCommandTest to commands * Test HugoCommand in hugo * Remove onchange module * Fewer assumptions about timing in FileWatcherTest Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
- Loading branch information
1 parent
0197b7d
commit 9535cf6
Showing
7 changed files
with
187 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
commands/src/test/scala/com/reactific/riddl/commands/OnChangeCommandTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright 2022 Ossum, Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.reactific.riddl.commands | ||
|
||
import org.scalatest.matchers.must.Matchers | ||
import org.scalatest.wordspec.AnyWordSpec | ||
|
||
class OnChangeCommandTest extends AnyWordSpec with Matchers { | ||
"OnChangeCommand" should { "have a test" in { true must be(true) } } | ||
} |
41 changes: 41 additions & 0 deletions
41
hugo/src/test/scala/com/reactific/riddl/translator/hugo/HugoCommandTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.reactific.riddl.translator.hugo | ||
import com.reactific.riddl.testkit.RunCommandSpecBase | ||
|
||
class HugoCommandTest extends RunCommandSpecBase { | ||
|
||
val inputFile = "testkit/src/test/input/rbbq.riddl" | ||
val hugoConfig = "testkit/src/test/input/hugo.conf" | ||
val validateConfig = "testkit/src/test/input/validate.conf" | ||
val outputDir: String => String = | ||
(name: String) => s"riddlc/target/test/$name" | ||
|
||
"HugoCommand" should { | ||
"handle hugo" in { | ||
val args = Seq( | ||
"--quiet", | ||
"--suppress-missing-warnings", | ||
"--suppress-style-warnings", | ||
"hugo", | ||
inputFile, | ||
"-o", | ||
outputDir("hugo") | ||
) | ||
runWith(args) | ||
} | ||
"handle hugo from config" in { | ||
val args = Seq( | ||
"--verbose", | ||
"--suppress-missing-warnings", | ||
"--suppress-style-warnings", | ||
"from", | ||
hugoConfig, | ||
"hugo" | ||
) | ||
runWith(args) | ||
// runHugo(path) | ||
// val root = Path.of(output).resolve(path) | ||
// val img = root.resolve("static/images/RBBQ.png") | ||
// Files.exists(img) mustBe true | ||
} | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
onchange/src/main/scala/com/reactific/riddl/translator/onchange/OnChange.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.