blob: c7e051934f2acadc4d2b3c02f3a080945a6bbe11 [file] [log] [blame]
package com.googlesource.gerrit.plugins.analytics.wizard
import java.io.File
import java.nio.file.Path
import org.scalatest.{FlatSpec, Matchers}
class AnalyticDashboardSetupSpec extends FlatSpec with Matchers {
behavior of "AnalyticDashboardSetup"
it should "create a config file with correct name" in {
var gotFilename: Option[Path] = None
class MockWriter extends ConfigWriter {
override def write(filename: Path, out: String): Unit = {
gotFilename = Some(filename)
}
}
implicit val writer = new MockWriter()
val composeYamlFile = File.createTempFile(getClass.getName, ".yaml").toPath
val ads = AnalyticDashboardSetup("aProject", composeYamlFile)
ads.createDashboardSetupFile()
gotFilename shouldBe Some(composeYamlFile)
}
}