Sha256: 713a7671dab297187c57de205848c193fbdbfed11c08753b639f9929a15743e9

Contents?: true

Size: 597 Bytes

Versions: 62

Compression:

Stored size: 597 Bytes

Contents

#!/usr/bin/env bats

@test "correct arguments" {
    run bash error_handling.sh Alice
    
    [ "$status" -eq 0 ]
    [ "$output" = "Hello, Alice" ]
}

@test "one long argument" {
    run bash error_handling.sh "Alice and Bob"
    
    [ "$status" -eq 0 ]
    [ "$output" = "Hello, Alice and Bob" ]
}

@test "incorrect arguments" {
    run bash error_handling.sh Alice Bob

    [ "$status" -ne 0 ]
}

@test "use errexit" {
    source error_handling.sh
    [ echo $SHELLOPTS | grep -q 'errexit' ]
}

@test "use nounset" {
    source error_handling.sh
    [ echo $SHELLOPTS | grep -q 'nounset' ]
}

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
trackler-2.2.1.26 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.25 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.24 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.23 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.22 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.21 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.20 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.19 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.18 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.17 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.16 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.15 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.14 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.13 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.12 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.11 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.10 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.9 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.8 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.7 tracks/bash/exercises/error-handling/error_handling_test.sh