diff --git a/tests/abuild_fetch_test b/tests/abuild_fetch_test index d662da2..90c3834 100755 --- a/tests/abuild_fetch_test +++ b/tests/abuild_fetch_test @@ -3,7 +3,8 @@ . $(atf_get_srcdir)/test_env.sh init_tests \ abuild_fetch_help \ - abuild_fetch_curl_invocation + abuild_fetch_curl_invocation \ + abuild_fetch_curl_failure create_fake_curl() { mkdir bin @@ -37,3 +38,15 @@ abuild_fetch_curl_invocation_body() { abuild-fetch https://example.com/non-existing } +abuild_fetch_curl_failure_body() { + create_fake_curl + # verify that fake curl works + CURL_EXITCODE=1 atf_check -s exit:$CURL_EXITCODE \ + -o match:"Fake curl invoked" \ + curl + CURL_EXITCODE=1 atf_check -s exit:$CURL_EXITCODE \ + -o match:"Fake curl invoked" \ + -e empty \ + abuild-fetch https://example.com/non-existing +} +