Skip to content
Myr

[Tests] Add unit test for nvm_download

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by nmarghetti · committed by Jordan Harband · parent 9f3397a · Browse files · 2 files+36 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+36 added−0 removed

  • tests:+36 added−0 removed

2 files+36 added−0 removed

added:test/fast/Unit tests/nvm_download+18 added
1#!/bin/sh23cleanup () {4 unset -f die cleanup5}6die () { echo "$@" ; cleanup ; exit 1; }78\. ../../../nvm.sh910set -ex1112# nvm_download install.sh13nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh" >/dev/null || die "nvm_download unable to download install.sh"1415# nvm_download should fail to download wrong_install.sh16! nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/master/wrong_install.sh" >/dev/null || die "nvm_download should fail to download no existing file"1718cleanup
added:test/install_script/nvm_download+18 added
1#!/bin/sh23cleanup () {4 unset -f die cleanup5}6die () { echo "$@" ; cleanup ; exit 1; }78NVM_ENV=testing \. ../../install.sh910# nvm_download install.sh11nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh" >/dev/null || die "nvm_download unable to download install.sh"1213# nvm_download should fail to download wrong_install.sh14if nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/master/wrong_install.sh" &>/dev/null; then15 die "nvm_download should fail to download no existing file"16fi1718cleanup