Skip to content

Commit

Permalink
tests a completely successful check
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkarns committed Aug 12, 2019
1 parent 4d3b7f0 commit 88f95ed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/doctor.bats
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,21 @@ load test_helper

assert_line "Auditing installed plugins: OK"
}

@test "reports clean setup" {
with_nodenv
with_nodenv_root
with_nodenv_plugin nodenv-install
with_nodes 10.2.3

run nodenv-doctor

assert_success
assert_output - -e <<-OUT
Checking for \`nodenv' in PATH: $PWD/node_modules/.bin/nodenv
Checking for nodenv shims in PATH: OK
Checking \`nodenv install' support: $NODENV_ROOT/plugins/nodenv-install/bin/nodenv-install \(.*\)
Counting installed Node versions: 1 versions
Auditing installed plugins: OK
OUT
}
4 changes: 4 additions & 0 deletions test/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ if [ -z "$TEST_DIR" ]; then
export PATH
fi

teardown() {
rm -rf "${TEST_DIR:?}"
}

with_nodenv_in_home() {
local nodenv="$PWD/node_modules/.bin/nodenv"

Expand Down

0 comments on commit 88f95ed

Please sign in to comment.