-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bats | ||
|
||
load 'test_helper' | ||
fixtures 'symlink' | ||
|
||
# Correctness | ||
@test 'assert_symlink_to() <file> <link>: returns 0 if <link> exists and is a symbolic link to <file>' { | ||
local -r file="${TEST_FIXTURE_ROOT}/file" | ||
local -r link="${TEST_FIXTURE_ROOT}/link" | ||
run assert_symlink_to $file $link | ||
[ "$status" -eq 0 ] | ||
[ "${#lines[@]}" -eq 0 ] | ||
} | ||
|
||
@test 'assert_symlink_to() <file> <link>: returns 1 and displays path if <link> is not a symbolic link to <file>' { | ||
local -r file="${TEST_FIXTURE_ROOT}/dir/file.does_not_exist" | ||
local -r link="${TEST_FIXTURE_ROOT}/link" | ||
run assert_symlink_to $file $link | ||
[ "$status" -eq 1 ] | ||
[ "${#lines[@]}" -eq 3 ] | ||
[ "${lines[0]}" == '-- symbolic link does not have the correct target --' ] | ||
[ "${lines[1]}" == "path : $link" ] | ||
[ "${lines[2]}" == '--' ] | ||
} | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
file |
95896f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marema31 Kinda similar change has been merged to my fork of the project: bats-core#18