Skip to content

Commit

Permalink
Add test case for RiddlFilesTestBase
Browse files Browse the repository at this point in the history
* Also move IncludeAndImportTest to tests not main!

Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Nov 14, 2022
1 parent 6493e16 commit 8f78b89
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 75 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/sonar.yml

This file was deleted.

This file was deleted.

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")
}
}
}

0 comments on commit 8f78b89

Please sign in to comment.