diff --git a/test/fast/Unit tests/iojs.org-dist-index.tab b/test/fast/Unit tests/mocks/iojs.org-dist-index.tab similarity index 100% rename from test/fast/Unit tests/iojs.org-dist-index.tab rename to test/fast/Unit tests/mocks/iojs.org-dist-index.tab diff --git a/test/fast/Unit tests/nodejs.org-dist-index.tab b/test/fast/Unit tests/mocks/nodejs.org-dist-index.tab similarity index 100% rename from test/fast/Unit tests/nodejs.org-dist-index.tab rename to test/fast/Unit tests/mocks/nodejs.org-dist-index.tab diff --git a/test/fast/Unit tests/nvm_ls_remote b/test/fast/Unit tests/nvm_ls_remote index 95759e1..ed4e2c1 100755 --- a/test/fast/Unit tests/nvm_ls_remote +++ b/test/fast/Unit tests/nvm_ls_remote @@ -9,7 +9,7 @@ cleanup() { . ../../../nvm.sh # sample output at the time the test was written -TAB_PATH="$PWD/nodejs.org-dist-index.tab" +TAB_PATH="$PWD/mocks/nodejs.org-dist-index.tab" nvm_download() { cat "$TAB_PATH" } diff --git a/test/fast/Unit tests/nvm_ls_remote_iojs b/test/fast/Unit tests/nvm_ls_remote_iojs index d93e077..03bb417 100755 --- a/test/fast/Unit tests/nvm_ls_remote_iojs +++ b/test/fast/Unit tests/nvm_ls_remote_iojs @@ -9,7 +9,7 @@ cleanup() { . ../../../nvm.sh # sample output at the time the test was written -TAB_PATH="$PWD/iojs.org-dist-index.tab" +TAB_PATH="$PWD/mocks/iojs.org-dist-index.tab" nvm_download() { cat "$TAB_PATH" } diff --git a/update_test_mocks.sh b/update_test_mocks.sh new file mode 100755 index 0000000..7f42195 --- /dev/null +++ b/update_test_mocks.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +echo 'Updating test mocks...' + +MOCKS_DIR="$PWD/test/fast/Unit tests/mocks" + +echo "creating $MOCKS_DIR" +mkdir -p MOCKS_DIR + +. "$NVM_DIR/nvm.sh" + +nvm_download -L -s "$NVM_NODEJS_ORG_MIRROR/index.tab" -o - > "$MOCKS_DIR/nodejs.org-dist-index.tab" +nvm_download -L -s "$NVM_IOJS_ORG_MIRROR/index.tab" -o - > "$MOCKS_DIR/iojs.org-dist-index.tab" + +echo "done! Don't forget to git commit them."