mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-10-04 23:11:08 +02:00
Previously, if `http get` failed, the `download_tarball` function would still continue since the ERR trap had no effect at that point. Given a script in the form of `{ ... } || return 1`, the expressions that are the part of the first group are not subject to ERR trap since they are non-last in a chain of expressions. However, since we still can't count on the ERR trap taking effect in this phase, better just rewrite the function to manually abort. Fixes #394
14 lines
387 B
Bash
14 lines
387 B
Bash
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
export RUBY_BUILD_SKIP_MIRROR=1
|
|
export RUBY_BUILD_CACHE_PATH=
|
|
|
|
@test "failed download displays error message" {
|
|
stub curl false
|
|
|
|
install_fixture definitions/without-checksum
|
|
assert_failure
|
|
assert_output_contains "> http://example.com/packages/package-1.0.0.tar.gz"
|
|
assert_output_contains "error: failed to download package-1.0.0.tar.gz"
|
|
}
|