-
-
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.
Add test case for RiddlFilesTestBase
* Also move IncludeAndImportTest to tests not main! Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
- Loading branch information
1 parent
6493e16
commit 8f78b89
Showing
4 changed files
with
35 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
testkit/src/main/scala/com/reactific/riddl/testkit/TranslatingTestBase.scala
This file was deleted.
Oops, something went wrong.
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
testkit/src/test/scala/com/reactific/riddl/testkit/RiddlFilesTestBaseTest.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,35 @@ | ||
package com.reactific.riddl.testkit | ||
|
||
import org.scalatest.Assertion | ||
|
||
import java.io.File | ||
import java.nio.file.Path | ||
|
||
class RiddlFilesTestBaseTest extends RiddlFilesTestBase { | ||
|
||
def checkAFile(rootDir: Path, file: File): Assertion = { | ||
succeed | ||
} | ||
|
||
"RiddlFilesTestBase" should { | ||
"find riddl files" in { | ||
val dir = "testkit/src/test/input" | ||
val files = findRiddlFiles(new File(dir), true) | ||
files.size must be > 0 | ||
} | ||
"not find non-files" in { | ||
intercept[org.scalatest.exceptions.TestFailedException] { | ||
processAFile("foo.txt") | ||
} | ||
} | ||
"require .riddl suffix" in { | ||
intercept[org.scalatest.exceptions.TestFailedException] { | ||
processAFile("testkit/src/test/input/hugo.conf") | ||
} | ||
} | ||
"handle a file or directory" in { | ||
processADirectory("testkit/src/test/input/hugo.conf") | ||
processADirectory("testkit/src/test/input/domains") | ||
} | ||
} | ||
} |