Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
Don't test the installer, since it requires an internet connection (#20)
Browse files Browse the repository at this point in the history
Internet connections can be flaky, so tests should not rely on them
  • Loading branch information
devurandom authored and michaelcontento committed Apr 2, 2017
1 parent 11d8aa7 commit c0917d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
21 changes: 21 additions & 0 deletions tests/installer.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bats

setup() {
cd $BATS_TEST_DIRNAME
unset CIRCLE_NODE_TOTAL
unset CIRCLE_NODE_INDEX
}

@test "installer" {
rm -rf ~/.local/bin/circleci-matrix
# Only remove the whole folder if it's empty!
if [ $(ls -1 ~/.local/bin | wc -l) -eq 0 ]; then
rm -rf ~/.local/bin
fi

$BATS_TEST_DIRNAME/../src/install.sh

[ -f ~/.local/bin/circleci-matrix ]
[ -x ~/.local/bin/circleci-matrix ]
~/.local/bin/circleci-matrix --version
}
14 changes: 0 additions & 14 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ circleci-matrix() {
$BATS_TEST_DIRNAME/../src/circleci-matrix.sh $@
}

@test "installer" {
rm -rf ~/.local/bin/circleci-matrix
# Only remove the whole folder if it's empty!
if [ $(ls -1 ~/.local/bin | wc -l) -eq 0 ]; then
rm -rf ~/.local/bin
fi

$BATS_TEST_DIRNAME/../src/install.sh

[ -f ~/.local/bin/circleci-matrix ]
[ -x ~/.local/bin/circleci-matrix ]
~/.local/bin/circleci-matrix --version
}

@test "print version" {
circleci-matrix | grep "circleci-matrix version: 1.0.0"
}
Expand Down

0 comments on commit c0917d0

Please sign in to comment.