Adding more functionality tests

This commit is contained in:
Alex Epstein 2017-07-09 17:46:48 -04:00
parent 82d6d05405
commit 6ecdf11dd6
4 changed files with 52 additions and 0 deletions

View File

@ -16,6 +16,14 @@
[ "${lines[0]}" = "Currency" ]
}
@test "Testing currency exchange (12.35 EUR TO USD)" {
run currency EUR USD 12.35
[ "$status" -eq 0 ]
[ "${lines[0]}" = "=========================" ]
[ "${lines[1]}" = "| EUR to USD" ]
[ "${lines[3]}" = "| EUR: 12.35" ]
}
@test "Get the tools version with -v" {
run currency -v
[ "$status" -eq 0 ]

View File

@ -16,6 +16,20 @@
[ "${lines[0]}" = "Qrify" ]
}
@test "Getting the qr code for a test string" {
run qrify this is a test string
[ "$status" -eq 0 ]
[ "${lines[0]}" = "█████████████████████████████████" ]
[ "${lines[1]}" = "█████████████████████████████████" ]
[ "${lines[2]}" = "████ ▄▄▄▄▄ ██▀▄████ ██ ▄▄▄▄▄ ████" ]
[ "${lines[3]}" = "████ █ █ █▄▀█▄▀█ ▀▀█ █ █ ████" ]
[ "${lines[4]}" = "████ █▄▄▄█ ██▄▀▀ ▄ ▀█ █▄▄▄█ ████" ]
}
@test "No arguments prints usage instructions" {
run qrify
[ "$status" -eq 0 ]

View File

@ -18,6 +18,30 @@
[ "${lines[0]}" = "Taste" ]
}
@test "Testing short recommendations" {
run taste Kid Cudi
[ "$status" -eq 0 ]
[ "${lines[0]}" = "===================================" ]
[ "${lines[1]}" = "Lupe Fiasco: music" ]
[ "${lines[2]}" = "Shadows And Fog: movie" ]
[ "${lines[3]}" = "Lulu James: music" ]
[ "${lines[4]}" = "===================================" ]
}
@test "Testing long recommendations" {
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," ]
}
@test "Testing search on item" {
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." ]
}
@test "No arguments prints usage instructions" {
run taste
[ "$status" -eq 0 ]

View File

@ -16,6 +16,12 @@
[ "${lines[0]}" = "Weather" ]
}
@test "Testing weather with specified location" {
run weather Paramus
[ "$status" -eq 0 ]
[ "${lines[0]}" = "Weather report: Paramus, United States of America" ]
}
@test "Get the tools version with -v" {
run weather -v
[ "$status" -eq 0 ]