Run versionLT tests in the image we are building
OS X sort doesn't have -V
Ensure the sort in the image, not the one in the build machine, works
diff --git a/tests/functions.bats b/tests/functions.bats
index 6745b10..b89de8c 100644
--- a/tests/functions.bats
+++ b/tests/functions.bats
@@ -1,24 +1,31 @@
#!/usr/bin/env bats
+SUT_IMAGE=bats-jenkins
+
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load test_helpers
. $BATS_TEST_DIRNAME/../jenkins-support
+@test "build image" {
+ cd $BATS_TEST_DIRNAME/..
+ docker build -t $SUT_IMAGE .
+}
+
@test "versionLT" {
- run versionLT 1.0 1.0
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0"
assert_failure
- run versionLT 1.0 1.1
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.1"
assert_success
- run versionLT 1.1 1.0
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.1 1.0"
assert_failure
- run versionLT 1.0-beta-1 1.0
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0"
assert_success
- run versionLT 1.0 1.0-beta-1
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0-beta-1"
assert_failure
- run versionLT 1.0-alpha-1 1.0-beta-1
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-alpha-1 1.0-beta-1"
assert_success
- run versionLT 1.0-beta-1 1.0-alpha-1
+ run docker run -ti --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0-alpha-1"
assert_failure
}