From 96afff7af2c3bd20bc9d0aa610ba888b20f163ea Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 19 Apr 2016 22:49:49 -0700 Subject: [PATCH] =?UTF-8?q?[Tests]=20Set=20up=20=E2=80=9Cmocks=E2=80=9D=20?= =?UTF-8?q?directory,=20and=20updater=20script.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => mocks}/iojs.org-dist-index.tab | 0 .../{ => mocks}/nodejs.org-dist-index.tab | 0 test/fast/Unit tests/nvm_ls_remote | 2 +- test/fast/Unit tests/nvm_ls_remote_iojs | 2 +- update_test_mocks.sh | 17 +++++++++++++++++ 5 files changed, 19 insertions(+), 2 deletions(-) rename test/fast/Unit tests/{ => mocks}/iojs.org-dist-index.tab (100%) rename test/fast/Unit tests/{ => mocks}/nodejs.org-dist-index.tab (100%) create mode 100755 update_test_mocks.sh 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."