var http = require('http'),
	exec = require('child_process').exec,
	assert = require('chai').assert;

describe('wookie http server', function() {
	describe('wookie http parser', function() {

	});

	// make sure it make's fine!
	it('should compile without error', function(done) {
		exec('make', function(error, stdout, stdin) {
			assert.notOk(error, 'gives error on make');
			done();
		});
	});

	// gotta start the web server
	before(function() {
		this.timeout(10000);
		
		exec('./wookie 127.0.0.1 8080', function(err, stdout, stderr) {
			// is running
		});
	});

	// does the server actually work?
	it('should give 200 on GET / request', function(done) {
		http.get('http://localhost:8080/', function(res) {
			assert.equal(200, res.statusCode, 'does not give 200 response code');
			done();
		}).on('error', function(err) {
			assert.notOk(err, 'does not give 200 response code (error)');
			done();
		});
	});
});
@@ -286,16 +286,24 @@
 ec('make
+ example
 ', funct
@@ -921,12 +921,373 @@
 %7D);%0A%09%7D);
+%0A%0A%09// gives 404%0A%09it('should give 404 on GET /no-resource-here request', function(done) %7B%0A%09%09http.get('http://localhost:8080/no-resource-here', function(res) %7B%0A%09%09%09assert.equal(404, res.statusCode, 'does not give 404 response code');%0A%09%09%09done();%0A%09%09%7D).on('error', function(err) %7B%0A%09%09%09assert.notOk(err, 'does not give 404 response code (error)');%0A%09%09%09done();%0A%09%09%7D);%0A%09%7D);
 %0A%7D);

test for 404