-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests for successful installation source parsing
- Loading branch information
1 parent
e28700d
commit f9ad435
Showing
3 changed files
with
36 additions
and
6 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
30 changes: 30 additions & 0 deletions
30
cmtc/src/test/scala/com/lunatech/cmt/client/cli/InstallArgumentsSpec.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,30 @@ | ||
package com.lunatech.cmt.client.cli | ||
|
||
import caseapp.Parser | ||
import caseapp.core.Error.Other | ||
import com.lunatech.cmt.client.Domain.InstallationSource.{GithubProject, LocalDirectory, ZipFile} | ||
import com.lunatech.cmt.client.command.{GotoExercise, Install} | ||
import com.lunatech.cmt.support.TestDirectories | ||
import sbt.io.syntax.{File, file} | ||
import com.lunatech.cmt.client.cli.ArgParsers.given | ||
|
||
final class InstallArgumentsSpec extends CommandLineArgumentsSpec[Install.Options] with TestDirectories { | ||
|
||
val identifier = "install" | ||
|
||
val parser: Parser[Install.Options] = Parser.derive | ||
|
||
def invalidArguments(tempDirectory: File) = invalidArgumentsTable() | ||
|
||
def validArguments(tempDirectory: File) = validArgumentsTable( | ||
( | ||
Seq("-s", baseDirectory.getAbsolutePath), | ||
Install.Options(LocalDirectory(baseDirectory))), | ||
( | ||
Seq("-s", zippedCourse), | ||
Install.Options(ZipFile(file(zippedCourse)))), | ||
( | ||
Seq("-s", "bleep/bloop"), | ||
Install.Options(GithubProject(organisation = "bleep", project = "bloop"))) | ||
) | ||
} |
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