|
|
@ -21,7 +21,7 @@ function teardown {
|
|
|
|
|
|
|
|
|
|
|
|
@test "run 'add' normally" {
|
|
|
|
@test "run 'add' normally" {
|
|
|
|
# Preparations:
|
|
|
|
# Preparations:
|
|
|
|
local filename="local_file"
|
|
|
|
local filename="$TEST_DEFAULT_FILENAME"
|
|
|
|
echo "content" > "$filename"
|
|
|
|
echo "content" > "$filename"
|
|
|
|
echo "$filename" > ".gitignore"
|
|
|
|
echo "$filename" > ".gitignore"
|
|
|
|
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ function teardown {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@test "run 'add' for unignored file" {
|
|
|
|
@test "run 'add' for unignored file" {
|
|
|
|
local test_file='test_file'
|
|
|
|
local test_file="$TEST_DEFAULT_FILENAME"
|
|
|
|
touch "$test_file"
|
|
|
|
touch "$test_file"
|
|
|
|
echo "content" > "$test_file"
|
|
|
|
echo "content" > "$test_file"
|
|
|
|
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ function teardown {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@test "run 'add' for unignored file with '-i'" {
|
|
|
|
@test "run 'add' for unignored file with '-i'" {
|
|
|
|
local test_file='test_file.auto_ignore'
|
|
|
|
local test_file='test_file.auto_ignore' # TODO - paramaterize filename
|
|
|
|
touch "$test_file"
|
|
|
|
touch "$test_file"
|
|
|
|
echo "content" > "$test_file"
|
|
|
|
echo "content" > "$test_file"
|
|
|
|
|
|
|
|
|
|
|
@ -112,7 +112,7 @@ function teardown {
|
|
|
|
local root='test_dir'
|
|
|
|
local root='test_dir'
|
|
|
|
local node="$root/node"
|
|
|
|
local node="$root/node"
|
|
|
|
local sibling="$root/sibling"
|
|
|
|
local sibling="$root/sibling"
|
|
|
|
local test_file="$node/test_file"
|
|
|
|
local test_file="$node/$TEST_DEFAULT_FILENAME"
|
|
|
|
local current_dir=$(pwd)
|
|
|
|
local current_dir=$(pwd)
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p "$node"
|
|
|
|
mkdir -p "$node"
|
|
|
@ -124,7 +124,7 @@ function teardown {
|
|
|
|
cd "$sibling"
|
|
|
|
cd "$sibling"
|
|
|
|
|
|
|
|
|
|
|
|
# Testing:
|
|
|
|
# Testing:
|
|
|
|
run git secret add "../node/test_file"
|
|
|
|
run git secret add "../node/$TEST_DEFAULT_FILENAME"
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ "$output" == *"1 item(s) added."* ]]
|
|
|
|
[[ "$output" == *"1 item(s) added."* ]]
|
|
|
|
|
|
|
|
|
|
|
@ -143,7 +143,7 @@ function teardown {
|
|
|
|
|
|
|
|
|
|
|
|
@test "run 'add' for file in subfolder" {
|
|
|
|
@test "run 'add' for file in subfolder" {
|
|
|
|
# Preparations:
|
|
|
|
# Preparations:
|
|
|
|
local test_file='test_file'
|
|
|
|
local test_file="$TEST_DEFAULT_FILENAME"
|
|
|
|
local test_dir='test_dir'
|
|
|
|
local test_dir='test_dir'
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p "$test_dir"
|
|
|
|
mkdir -p "$test_dir"
|
|
|
@ -163,7 +163,7 @@ function teardown {
|
|
|
|
|
|
|
|
|
|
|
|
@test "run 'add' twice for one file" {
|
|
|
|
@test "run 'add' twice for one file" {
|
|
|
|
# Preparations:
|
|
|
|
# Preparations:
|
|
|
|
local filename="local_file"
|
|
|
|
local filename="$TEST_DEFAULT_FILENAME"
|
|
|
|
echo "content" > "$filename"
|
|
|
|
echo "content" > "$filename"
|
|
|
|
echo "$filename" > ".gitignore"
|
|
|
|
echo "$filename" > ".gitignore"
|
|
|
|
|
|
|
|
|
|
|
@ -187,11 +187,11 @@ function teardown {
|
|
|
|
|
|
|
|
|
|
|
|
@test "run 'add' for multiple files" {
|
|
|
|
@test "run 'add' for multiple files" {
|
|
|
|
# Preparations:
|
|
|
|
# Preparations:
|
|
|
|
local filename1="local_file1"
|
|
|
|
local filename1="$TEST_DEFAULT_FILENAME"
|
|
|
|
echo "content1" > "$filename1"
|
|
|
|
echo "content1" > "$filename1"
|
|
|
|
echo "$filename1" > ".gitignore"
|
|
|
|
echo "$filename1" > ".gitignore"
|
|
|
|
|
|
|
|
|
|
|
|
local filename2="local_file2"
|
|
|
|
local filename2="$TEST_SECOND_FILENAME"
|
|
|
|
echo "content2" > "$filename2"
|
|
|
|
echo "content2" > "$filename2"
|
|
|
|
echo "$filename2" >> ".gitignore"
|
|
|
|
echo "$filename2" >> ".gitignore"
|
|
|
|
|
|
|
|
|
|
|
|