mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Adding more functionality tests
This commit is contained in:
parent
82d6d05405
commit
6ecdf11dd6
@ -16,6 +16,14 @@
|
|||||||
[ "${lines[0]}" = "Currency" ]
|
[ "${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" {
|
@test "Get the tools version with -v" {
|
||||||
run currency -v
|
run currency -v
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
@ -16,6 +16,20 @@
|
|||||||
[ "${lines[0]}" = "Qrify" ]
|
[ "${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" {
|
@test "No arguments prints usage instructions" {
|
||||||
run qrify
|
run qrify
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
@ -18,6 +18,30 @@
|
|||||||
[ "${lines[0]}" = "Taste" ]
|
[ "${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" {
|
@test "No arguments prints usage instructions" {
|
||||||
run taste
|
run taste
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
@ -16,6 +16,12 @@
|
|||||||
[ "${lines[0]}" = "Weather" ]
|
[ "${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" {
|
@test "Get the tools version with -v" {
|
||||||
run weather -v
|
run weather -v
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
Loading…
Reference in New Issue
Block a user