Only testing taste tool with Darwin (trying travis for PR's again)

This commit is contained in:
Alex Epstein 2017-08-02 12:13:41 -04:00
parent 99fb3378ef
commit a9ec032624
1 changed files with 12 additions and 7 deletions

View File

@ -6,21 +6,17 @@
}
@test "Check for latest version of bash-snippets on update" {
if [[ "$(uname)" == "Linux" ]];then
run taste update
[ "$status" -eq 0 ]
[ "$output" = "Bash-Snippets is already the latest version" ]
fi
}
@test "The -h option should print usage" {
if [[ "$(uname)" == "Darwin" ]]; then
run taste -h
[ "$status" -eq 0 ]
[ "${lines[0]}" = "Taste" ]
fi
}
@test "Testing short recommendations" {
if [[ "$(uname)" == "Darwin" ]]; then
run taste Kid Cudi
[ "$status" -eq 0 ]
[ "${lines[0]}" = "===================================" ]
@ -28,31 +24,40 @@ fi
[ "${lines[2]}" = "Shadows And Fog: movie" ]
[ "${lines[3]}" = "Lulu James: music" ]
[ "${lines[4]}" = "===================================" ]
fi
}
@test "Testing long recommendations" {
if [[ "$(uname)" == "Darwin" ]]; then
run taste -i Sublime
[ "$status" -eq 0 ]
response=$(echo $(taste -i Sublime) | grep -Eo "Soundsystem is the fifth studio album by 311, released on October 12, 1999. Soundsystem, which was certified Gold by the RIAA,")
[ "$response" = "Soundsystem is the fifth studio album by 311, released on October 12, 1999. Soundsystem, which was certified Gold by the RIAA," ]
fi
}
@test "Testing search on item" {
if [[ "$(uname)" == "Darwin" ]]; then
run taste -s Kendrick Lamar
[ "$status" -eq 0 ]
response=$(echo $(taste -s Kendrick Lamar) | grep -Eo "Kendrick Lamar Duckworth \(born June 17, 1987\) is an American rapper and songwriter.")
[ "$response" = "Kendrick Lamar Duckworth (born June 17, 1987) is an American rapper and songwriter." ]
fi
}
@test "No arguments prints usage instructions" {
if [[ "$(uname)" == "Darwin" ]]; then
run taste
[ "$status" -eq 0 ]
[ "${lines[0]}" = "Taste" ]
fi
}
@test "Get the tools version with -v" {
if [[ "$(uname)" == "Darwin" ]]; then
run taste -v
[ "$status" -eq 0 ]
result=$( echo $(taste -v) | grep -Eo "Version")
[ "$result" = "Version" ]
fi
}