Commit 2be6cdd6 authored by Sander Bollen's avatar Sander Bollen
Browse files

trimmed VersionCommand and test class

parent 0358aae4
...@@ -32,8 +32,11 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver ...@@ -32,8 +32,11 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Ver
protected var script: File = new File("/nl/lumc/sasc/biopet/extensions/cnmops.R") protected var script: File = new File("/nl/lumc/sasc/biopet/extensions/cnmops.R")
def versionCommand = super.cmdLine + "--version" def versionCommand = {
def versionRegex = "\\d+\\.\\d+\\.\\d+".r val v = super.cmdLine + "--version"
v.trim.replace("'", "")
}
def versionRegex = "(\\d+\\.\\d+\\.\\d+)".r
private def stringToInt(s: String): Option[Int] = { private def stringToInt(s: String): Option[Int] = {
try { try {
......
package nl.lumc.sasc.biopet.extensions
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
/**
* Created by Sander Bollen on 17-10-16.
*/
class CnmopsTest extends TestNGSuite with Matchers {
@Test
def testVersionCommand() = {
val cn = new Cnmops(null)
cn.versionCommand.endsWith("--version") shouldBe true
cn.versionCommand.startsWith("'Rscript'") shouldBe true
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment