Given Test

Contents

Inner Test Ranges Over Values / n

Specification

        Given t inner given some stuffs "a"
        When
        Givens "value" = test value
        Givens "expected" = test expected
        Captured io "actual" = len test value
        Then
        Assert that testing t actual "actual" is equal to test expected

Test results:

TEST PASSED
        

Interesting Givens

value n
expected 1

actual

1

Inner Test Ranges Over Values / aa

Specification

        Given t inner given some stuffs "a"
        When
        Givens "value" = test value
        Givens "expected" = test expected
        Captured io "actual" = len test value
        Then
        Assert that testing t actual "actual" is equal to test expected

Test results:

TEST PASSED
        

Interesting Givens

value aa
expected 2

actual

2

test

Specification

        Given t some data setup and more data setup
        Skipping this one "some reason"
        When some action
        Then
        Noting that do assertions
        Assert that testing t skipped is equal to true
        Assert that testing t test output is equal to "some reason"

Test results:

TEST SKIPPED
        some reason

Interesting Givens

1 hi
2 foo
blarg 12

foo

foob

Go Given Fails In Meta Data

Specification

        Given stub testing t
        Then
        Testing t fail now
        Assert that t stub testing t failed is equal to true

Test results:

TEST FAILED
        

Interesting Givens

e

Specification

        Given testing t
        Some = append some given
        Given when
        Actual "value" = test actual
        Actual "expected" = test expected
        Then
        Noting that do assertions
        Test meta data = append test meta data t * base test meta data
        Assert that t test actual has length test expected
        Assert that testing some 0 captured io "value" is equal to ""
        Assert that testing some 0 captured io "expected" is equal to 0
        Assert that testing some 1 captured io "value" is equal to "a"
        Assert that testing some 1 captured io "expected" is equal to 2
        Assert that testing test meta data 0 failed is equal to false
        Assert that testing test meta data 1 failed is equal to true

Test results:

TEST PASSED
        

Interesting Givens

value

expected

0

Go Given Logs With Meta Data

Specification

        Given stub testing t
        Then
        Testing t logf "wobble bop"
        Assert that t stub testing t failed is equal to true
        Assert that t stub testing t test output is equal to "wobble bop"

Test results:

TEST FAILED
        wobble bop

Interesting Givens

Given When Sets Interesting Given

Specification

        Given testing some data setup
        When some action
        Then
        Noting that do assertions
        Assert that t actual "foo" is equal to "foob"

Test results:

TEST PASSED
        

Interesting Givens

1 hi
2 foo

foo

foob

Given When Stacks Givens

Specification

        Given testing some data setup and more data setup
        When some action
        Then
        Noting that do assertions
        Assert that testing givens has all keys "1" "2" "blarg"
        Assert that testing givens is value containing "hi" 12 "foo"
        Assert that testing actual has key "foo"

Test results:

TEST PASSED
        

Interesting Givens

2 foo
blarg 12
1 hi

foo

foob

e

Specification

        Given testing t
        Some = append some given
        Given when
        Actual "value" = test actual
        Actual "expected" = test expected
        Then
        Noting that do assertions
        Test meta data = append test meta data t * base test meta data
        Assert that t test actual has length test expected
        Assert that testing some 0 captured io "value" is equal to ""
        Assert that testing some 0 captured io "expected" is equal to 0
        Assert that testing some 1 captured io "value" is equal to "a"
        Assert that testing some 1 captured io "expected" is equal to 2
        Assert that testing test meta data 0 failed is equal to false
        Assert that testing test meta data 1 failed is equal to true

Test results:

TEST FAILED
        
Expected: value with length 2
     but: <length was 1>

Interesting Givens

value

a

expected

2