github.com/daniellockard/packer@v0.7.6-0.20141210173435-5a9390934716/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 0 ]
    21      [[ "$output" == *"Packer v"* ]]
    22  
    23      run packer --version
    24      [ "$status" -eq 0 ]
    25      [[ "$output" == *"Packer v"* ]]
    26  }
    27  
    28  @test "cli: packer version show help" {
    29      run packer version -h
    30      [ "$status" -eq 0 ]
    31      [[ "$output" == *"usage: packer version"* ]]
    32  
    33      run packer version --help
    34      [ "$status" -eq 0 ]
    35      [[ "$output" == *"usage: packer version"* ]]
    36  }