Added test for config with spaces

This commit is contained in:
Ludovic Perrine
2014-10-02 12:27:12 +02:00
committed by Jose Diaz-Gonzalez
parent 5dbc864060
commit 361011ec69
3 changed files with 18 additions and 2 deletions

View File

@@ -1,3 +1,15 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "config-test"
set -e;
base_url="$1"
test_url / "config-test"
test_url /hello "Hello world"
test_url () {
path="$1"
expected_output="$2"
url="$base_url$path"
output="$(curl -s $url)"
echo $output
test "$output" == "$expected_output"
}

View File

@@ -4,5 +4,5 @@ set -ex;
REMOTE=$1
REPO=$2
ssh $REMOTE config:set $REPO CONFTEST=config-test
ssh $REMOTE config:set $REPO CONFTEST=config-test HELLO="Hello world"

View File

@@ -6,6 +6,10 @@ app.get('/', function(request, response) {
response.send(process.env.CONFTEST);
});
app.get('/hello', function(request, response) {
response.send(process.env.HELLO);
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);