Skip to content

Commit

Permalink
Fix for tests under bats, fix typos, mention #334 (#342)
Browse files Browse the repository at this point in the history
* fix test under githooks, fix typos, mention #334 as relevant
  • Loading branch information
joshrabinowitz committed Feb 10, 2019
1 parent 26ecd39 commit 5a28744
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions tests/test_add.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function teardown {
# https://github.com/sobolevn/git-secret/issues/85 task 1

if [[ "$BATS_RUNNING_FROM_GIT" -eq 1 ]]; then
skip "this test is skipped while 'git commmit'"
# See #334 for more about this
skip "this test is skipped while 'git commit'"
fi

# Preparations:
Expand Down Expand Up @@ -105,7 +106,7 @@ function teardown {

@test "run 'add' for relative path" {
if [[ "$BATS_RUNNING_FROM_GIT" -eq 1 ]]; then
skip "this test is skipped while 'git commmit'"
skip "this test is skipped while 'git commit'. See #334"
fi

# Prepations:
Expand Down Expand Up @@ -142,6 +143,11 @@ function teardown {


@test "run 'add' for file in subfolder" {
if [[ "$BATS_RUNNING_FROM_GIT" -eq 1 ]]; then
# See #334 for more about this
skip "this test is skipped while 'git commit'"
fi

# Preparations:
local test_file="$TEST_DEFAULT_FILENAME"
local test_dir='test_dir'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_init.bats
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function teardown {
# https://github.com/sobolevn/git-secret/issues/83

if [[ "$BATS_RUNNING_FROM_GIT" -eq 1 ]]; then
skip "this test is skipped while 'git commmit'"
skip "this test is skipped while 'git commit'. See #334"
fi

# Preparations
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tell.bats
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function teardown {

@test "run 'tell' in subfolder" {
if [[ "$BATS_RUNNING_FROM_GIT" -eq 1 ]]; then
skip "this test is skipped while 'git commmit'"
skip "this test is skipped while 'git commit'. See #334"
fi

# Preparations
Expand Down
2 changes: 1 addition & 1 deletion tests/test_whoknows.bats
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function teardown {

@test "run 'whoknows' in subfolder" {
if [[ "$BATS_RUNNING_FROM_GIT" -eq 1 ]]; then
skip "this test is skipped while 'git commmit'"
skip "this test is skipped while 'git commit'. See #334"
fi

# Preparations:
Expand Down
2 changes: 1 addition & 1 deletion utils/hooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$BRANCH_NAME" != '(no branch)' ]]; then

# Set marker, that we running tests from `git commit`,
# so some tests will be skipped. It is done, because `git rev-parse`
# is not working when running from pre-commit hook.
# is not working when running from pre-commit hook. See #334
export BATS_RUNNING_FROM_GIT=1

# Run tests:
Expand Down

0 comments on commit 5a28744

Please sign in to comment.