github.com/iamthemuffinman/packer@v0.9.1-0.20160314165629-d0037dddb929/test/cli.bats (about) 1 #!/usr/bin/env bats 2 # 3 # This tests the basic CLI functionality of Packer. It makes no network 4 # requests and should be very fast. 5 6 load test_helper 7 8 @test "cli: packer should show help" { 9 run packer 10 [ "$status" -eq 1 ] 11 [[ "$output" == *"usage: packer"* ]] 12 } 13 14 @test "cli: packer version" { 15 run packer version 16 [ "$status" -eq 0 ] 17 [[ "$output" == *"Packer v"* ]] 18 19 run packer -v 20 [ "$status" -eq 1 ] 21 [[ "$output" =~ ([0-9]+\.[0-9]+) ]] 22 23 run packer --version 24 [ "$status" -eq 1 ] 25 [[ "$output" =~ ([0-9]+\.[0-9]+) ]] 26 } 27 28 @test "cli: packer version show help" { 29 run packer version -h 30 [ "$status" -eq 0 ] 31 [[ "$output" == *"Packer v"* ]] 32 33 run packer version --help 34 [ "$status" -eq 0 ] 35 [[ "$output" == *"Packer v"* ]] 36 }