Permalink
Browse files

failing test for setting env vars

  • Loading branch information...
1 parent 9c54897 commit d79400c3573f836deaabbc09d4f0cdfe701b95c7 @substack committed Mar 6, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −0 bin/cli.js
  2. +6 −1 test/command.js
  3. +1 −1 test/webapp/server.js
View
@@ -83,6 +83,7 @@ else if (cmd === 'spawn') {
repo : repo,
commit : commit,
command : command,
+ env : argv.env || {},
});
s.on('spawn', function () {
s.hub.close();
View
@@ -84,6 +84,7 @@ test('command line deploy', function (t) {
function run (commit) {
ps.run = spawn(cmd, [
'spawn', '--hub=localhost:' + port, '--secret=beepboop',
+ '--env.PROPAGIT_BEEPITY=boop',
'webapp', commit,
'node', 'server.js', httpPort,
]);
@@ -96,7 +97,11 @@ test('command line deploy', function (t) {
var data = '';
res.on('data', function (buf) { data += buf });
res.on('end', function () {
- t.equal(data, 'beep boop');
+ var obj = JSON.parse(data);
+ t.equal(obj[0], 'beepity');
+ t.equal(obj[1].REPO, 'webapp');
+ t.ok(obj[1].COMMIT.match(/^[0-9a-f]{40}$/));
+ t.ok(obj[1].PROPAGIT_BEEPITY, 'boop');
t.end();
});
});
View
@@ -2,5 +2,5 @@ var http = require('http');
var port = parseInt(process.argv[2], 10);
http.createServer(function (req, res) {
- res.end('beep boop');
+ res.end(JSON.stringify([ 'beepity', process.env ]));
}).listen(port);

0 comments on commit d79400c

Please sign in to comment.