<commit_before>/*
 * use-test.js: Basic tests for the carapace module
 *
 * (C) 2011 Nodejitsu Inc
 * MIT LICENCE
 *
 */
 
var assert = require('assert'),
    path = require('path'),
    exec = require('child_process').exec,
    http = require('http'),
    request = require('request'),
    vows = require('vows'),
    helper = require('../helper/macros.js'),
    carapace = require('../../lib/carapace');

var jail = path.join(__dirname, '..', '..', 'examples', 'app'),
    custom = path.join(__dirname, '..', 'fixtures', 'custom.js'),
    options;
    
options = {
  port: 5060,
  script: path.join(jail, 'server.js'),
  argv: ['--plugin', custom, '--plugin', 'heartbeat'],
  cwd: process.cwd(),
  keepalive: true
};
    
vows.describe('carapace/spawn/custom-plugin').addBatch({
  "When using haibu-carapace": {
    "spawning a child carapace with a custom plugin": helper.assertParentSpawn(options, {
      "after the plugin is loaded": {
        topic: function (info, child) {
          var that = this;
          child.once('message', function (info) {
            if (info.event === 'custom') {
              that.callback(null, child, info);
            }
          });
        },
        "should emit the `carapace::custom` event": function (_, child, info) {
          assert.isTrue(info.data.custom);
          child.kill();
        }
      }
    })
  }
}).export(module);<commit_msg>remove custom plugin tests<commit_after>/*
 * use-test.js: Basic tests for the carapace module
 *
 * (C) 2011 Nodejitsu Inc
 * MIT LICENCE
 *
 */

var assert = require('assert'),
    path = require('path'),
    exec = require('child_process').exec,
    http = require('http'),
    request = require('request'),
    vows = require('vows'),
    helper = require('../helper/macros.js'),
    carapace = require('../../lib/carapace');

var jail = path.join(__dirname, '..', '..', 'examples', 'app'),
    custom = path.join(__dirname, '..', 'fixtures', 'custom.js'),
    options;

options = {
  port: 5060,
  script: path.join(jail, 'server.js'),
  argv: ['--plugin', custom, '--plugin', 'heartbeat'],
  cwd: process.cwd(),
  keepalive: true
};

//vows.describe('carapace/spawn/custom-plugin').addBatch({
  //"When using haibu-carapace": {
    //"spawning a child carapace with a custom plugin": helper.assertParentSpawn(options, {
      //"after the plugin is loaded": {
        //topic: function (info, child) {
          //var that = this;
          //child.once('message', function (info) {
            //if (info.event === 'custom') {
              //that.callback(null, child, info);
            //}
          //});
        //},
        //"should emit the `carapace::custom` event": function (_, child, info) {
          //assert.isTrue(info.data.custom);
          //child.kill();
        //}
      //}
    //})
  //}
//}).export(module);
{'fraction_non_alphanumeric': 0.19124911785462245, 'fraction_numerical': 0.0056457304163726185, 'mean_word_length': 2.4280532043530836, 'pattern_counts': {'":': 8, '<': 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': '5094323', 'n_tokens_mistral': 927, 'n_tokens_neox': 905, 'n_words': 204}