diff --git a/src/commands/git_secret_add.sh b/src/commands/git_secret_add.sh index 29da19d1..a9168ae9 100644 --- a/src/commands/git_secret_add.sh +++ b/src/commands/git_secret_add.sh @@ -8,7 +8,7 @@ function add { while getopts "ih" opt; do case "$opt" in i) auto_add=1;; - h) _show_manaul_for "add";; + h) _show_manual_for "add";; esac done diff --git a/src/commands/git_secret_usage.sh b/src/commands/git_secret_usage.sh index 0e468771..2359fbfe 100644 --- a/src/commands/git_secret_usage.sh +++ b/src/commands/git_secret_usage.sh @@ -1,19 +1,6 @@ #!/usr/bin/env bash -function _show_help_usage { - cat <<-EOF -usage: git secret usage -prints all the available commands. - -options: - -h shows this help. - -EOF - exit 0 -} - - function usage { OPTIND=1 diff --git a/tests/test_add.bats b/tests/test_add.bats index b65944d3..e3157484 100644 --- a/tests/test_add.bats +++ b/tests/test_add.bats @@ -59,6 +59,22 @@ function teardown { } +@test "run 'add' for file in subdirectory" { + local TEST_FILE='test_file' + local TEST_DIR='test_dir' + + mkdir "$TEST_DIR" + touch "$TEST_DIR/$TEST_FILE" + echo "content" > "$TEST_DIR/$TEST_FILE" + echo "$TEST_DIR/$TEST_FILE" > ".gitignore" + + run git secret add "$TEST_DIR/$TEST_FILE" + rm -rf "$TEST_DIR" + + [ "$status" -eq 0 ] +} + + @test "run 'add' twice for one file" { local filename="local_file" echo "content" > "$filename"