Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bats |
| 2 | |
Carlos Sanchez | 0e026d2 | 2016-08-08 09:57:58 +0200 | [diff] [blame] | 3 | SUT_IMAGE=bats-jenkins |
| 4 | |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 5 | load 'test_helper/bats-support/load' |
| 6 | load 'test_helper/bats-assert/load' |
| 7 | load test_helpers |
| 8 | |
| 9 | . $BATS_TEST_DIRNAME/../jenkins-support |
| 10 | |
Carlos Sanchez | 0e026d2 | 2016-08-08 09:57:58 +0200 | [diff] [blame] | 11 | @test "build image" { |
| 12 | cd $BATS_TEST_DIRNAME/.. |
| 13 | docker build -t $SUT_IMAGE . |
| 14 | } |
| 15 | |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 16 | @test "versionLT" { |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 17 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 18 | assert_failure |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 19 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.1" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 20 | assert_success |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 21 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.1 1.0" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 22 | assert_failure |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 23 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 24 | assert_success |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 25 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0-beta-1" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 26 | assert_failure |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 27 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-alpha-1 1.0-beta-1" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 28 | assert_success |
Carlos Sanchez | 3e58be9 | 2016-09-16 18:32:23 -0700 | [diff] [blame^] | 29 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0-alpha-1" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 30 | assert_failure |
| 31 | } |