diff --git a/.travis.yml b/.travis.yml index 669dd25..2895a95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,6 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq bats - sudo apt-get install -qq vlc + - sudo apt-get install -qq openssl script: - bats tests diff --git a/tests/siteciphers.bats b/tests/siteciphers.bats new file mode 100755 index 0000000..b70a76d --- /dev/null +++ b/tests/siteciphers.bats @@ -0,0 +1,35 @@ +@test "Testing siteciphers tool" { + echo siteciphers +} + +@test "Check for latest version of bash-snippets on update" { + run siteciphers update + [ "$status" -eq 0 ] + [ "$output" = "Bash-Snippets is already the latest version" ] +} + +@test "No arguments prints usage instructions" { + run siteciphers + [ "$status" -eq 1 ] + [ "${lines[0]}" = "Siteciphers" ] +} + +@test "The -h option should print usage" { + run siteciphers -h + [ "$status" -eq 0 ] + [ "${lines[0]}" = "Siteciphers" ] +} + +@test "Running siteciphers on travis-ci" { + run siteciphers travis-ci.org + [ "$status" -eq 0 ] + [ "${lines[0]}" = "ECDHE-RSA-AES256-GCM-SHA384 - NO (tlsv1 alert insufficient security)" ] +} + + +@test "Get the tools version with -v" { + run siteciphers -v + [ "$status" -eq 0 ] + result=$( echo $(cheat -v) | grep -Eo "Version") + [ "$result" = "Version" ] +}