asm89 / smoke.sh

A minimal smoke testing framework in Bash.
MIT License
205 stars 56 forks source link

Assert response codes #2

Closed hamsterready closed 10 years ago

hamsterready commented 10 years ago

Hi mate,

Nice work re your shell lib.

Would be nice to have helper function to assert response codes - my use/test case is to verify that 403 is returned and now have to use something like:

smoke_url "http://example.com/something/"
    code=`smoke_response_code`
    if [ $code -ne "403" ]; then
        _smoke_fail "Expected 403 but was $code."
    fi

which probably is not how I should use _smoke_fail ;)(

asm89 commented 10 years ago

Something like smoke_assert_code would be nice indeed. :+1:

asm89 commented 10 years ago

@hamsterready I added smoke_assert_code.

hamsterready commented 10 years ago

Thanks for this mate... will update my scripts... in a meantime we create http://up-time.io/ for servers monitoring.