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.66 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.65 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.64 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.63 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.62 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.61 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.60 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.59 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.58 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.57 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.56 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.55 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.54 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.53 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.52 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.51 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.50 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.49 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.48 tracks/bash/exercises/error-handling/error_handling_test.sh
trackler-2.2.1.47 tracks/bash/exercises/error-handling/error_handling_test.sh