Skip to content

Commit

Permalink
Merge pull request #30 from astorije/astorije/improvements
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
astorije authored Feb 21, 2018
2 parents c53ec34 + 93f8c31 commit eb2a037
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ env:
- ANSIBLE_VERSION="2.1.*" # First released on 2016-05-25
- ANSIBLE_VERSION="2.0.*" # First released on 2016-01-12
- ANSIBLE_VERSION="1.9.*" # First released on 2015-03-26
before_install:
- sudo apt-get update -qq
install:
- pip install ansible==$ANSIBLE_VERSION
script:
Expand Down
11 changes: 6 additions & 5 deletions tests/tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
#!/bin/bash

set -e

# See http://stackoverflow.com/a/21189044/1935861
parse_yaml () {
Expand All @@ -22,16 +24,15 @@ url="http://localhost:9000/"
http_code=`curl -sw "%{http_code}\\n" -o /dev/null ${url}`
response=`curl -s $url`

# Extract lounge_version from the defaults
eval $(parse_yaml defaults/main.yml | grep 'lounge_version')
# TODO: Verify version of The Lounge in CLI stdout

if test $http_code != 200; then
printf "FAILURE: HTTP code should be 200, but was ${http_code} instead.\n"
exit 1
fi

if [[ $response != *"The Lounge is in version <strong>$lounge_version</strong>"* ]]; then
printf "FAILURE: \"The Lounge is in version <strong>$lounge_version</strong>\" was not found in the HTTP response.\n"
if [[ $response != *"<title>The Lounge</title>"* ]]; then
printf "FAILURE: \"<title>The Lounge</title>\" was not found in the HTTP response.\n"
exit 1
fi

Expand Down

0 comments on commit eb2a037

Please sign in to comment.