<commit_before>
var vows = require("vows");
var assert = require("assert");
var should = require("should");
var request = require("request");

var blueprint = require("../lib/blueprint");

vows.describe("General Module Tests").addBatch({
  "when requiring blueprint":{
    topic:function(){ 
      return blueprint;
    },
    "blueprint should be an object":function(topic){
      topic.should.be.a("object");
    }
  },
  "when creating an index route with a response":{
    topic:function(){
      var app = blueprint.createServer();
      app.get("/", function(request, response) {
        response.send({message:"don't taze me bro!"});
      });
      app.listen(8000);
      request("http://localhost:8000/", this.callback);
    },
    "we should be able to make a request and get back text/html, a 200 response code":function(error, response, body){
      assert.equal(error, null);
      assert.equal(response.statusCode, 200);
      assert.equal(response.headers["content-type"], "application/json");
    }
  },
  "when we serve up a non existing route":{
    topic:function(){
      request("http://localhost:8000/fake-stuff/", this.callback);
    },
    "we should be able to make a request and get back text/html, with a 404 response code":function(error, response, body){
      assert.equal(response.statusCode, 404);
    }
  }
}).export(module);

/* EOF */<commit_msg>test for no errors, more tests!<commit_after>
var vows = require("vows");
var assert = require("assert");
var should = require("should");
var request = require("request");

var blueprint = require("../lib/blueprint");

vows.describe("General Module Tests").addBatch({
  "when requiring blueprint":{
    topic:function(){ 
      return blueprint;
    },
    "blueprint should be an object":function(topic){
      topic.should.be.a("object");
    }
  },
  "when creating an index route with a response":{
    topic:function(){
      var app = blueprint.createServer();
      app.get("/", function(request, response) {
        response.send({message:"don't taze me bro!"});
      });
      app.listen(8000);
      request("http://localhost:8000/", this.callback);
    },
    "we should be able to make a request and get back text/html, a 200 response code":function(error, response, body){
      assert.equal(error, null);
      assert.equal(response.statusCode, 200);
      assert.equal(response.headers["content-type"], "application/json");
    }
  },
  "when we serve up a non existing route":{
    topic:function(){
      request("http://localhost:8000/fake-stuff/", this.callback);
    },
    "we should be able to make a request and get back text/html, with a 404 response code":function(error, response, body){
      assert.equal(error, null);
      assert.equal(response.statusCode, 404);
    }
  }
}).export(module);

/* EOF */
{'fraction_non_alphanumeric': 0.15737122557726466, 'fraction_numerical': 0.01705150976909414, 'mean_word_length': 3.4207221350078494, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4075615', 'n_tokens_mistral': 864, 'n_tokens_neox': 807, 'n_words': 229}