Skip to content

Instantly share code, notes, and snippets.

@thorntonrose
Last active July 31, 2018 19:35
Show Gist options
  • Save thorntonrose/1061eedaa5f0a9a1e1959e1f0cf224c6 to your computer and use it in GitHub Desktop.
Save thorntonrose/1061eedaa5f0a9a1e1959e1f0cf224c6 to your computer and use it in GitHub Desktop.
Jenkins Lib Testing - ToAlphanumericTest.groovy
import org.junit.*
import com.lesfurets.jenkins.unit.*
import static groovy.test.GroovyAssert.*
class ToAlphanumericTest extends BasePipelineTest {
def toAlphanumeric
@Before
void setUp() {
super.setUp()
// load toAlphanumeric
toAlphanumeric = loadScript("vars/toAlphanumeric.groovy")
}
@Test
void testCall() {
// call toAlphanumeric and check result
def result = toAlphanumeric(text: "a_B-c.1")
assertEquals "result:", "abc1", result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment