<commit_before>var Q = require('q');
var should = require('should');
var control = require('../lib/control');

describe('ejabberdctl', function() {
  it('should failed if ejabberdclt command is not found', function(done) {
    var promise = control._loadConfig('no_ejabberdctl');

    promise.then(function(stdout) {},
                 function(reason) {
                   setTimeout(done, 0);
                 });
  });

  it('should failed if config file is not found', function(done) {
    var promise = control._loadConfig('ejabberdctl', './fixture/no.cfg');

    promise.then(function(stdout) {},
                 function(reason) {
                   setTimeout(done, 0);
                 });
  });

 // it('should resolved if config file is found', function(done) {
 //    var promise = control._loadConfig('ejabberdctl', './fixture/hosts.cfg');

 //    promise.then(function(stdout) { setTimeout(done, 0);},
 //                 function(reason) {
 //                   //setTimeout(done, 0);
 //                 });
 //  }); 

});<commit_msg>load_config test<commit_after>var Q = require('q');
var path = require('path');
var should = require('should');
var control = require('../lib/control');

describe('ejabberdctl', function() {
  it('should failed if ejabberdclt command is not found', function(done) {
    var promise = control._loadConfig('no_ejabberdctl');

    promise.then(function(stdout) {},
                 function(reason) {
                   setTimeout(done, 0);
                 });
  });

  it('should failed if config file is not found', function(done) {
    var promise = control._loadConfig('ejabberdctl', './fixture/no.cfg');

    promise.then(function(stdout) {},
                 function(reason) {
                   setTimeout(done, 0);
                 });
  });

  it('should resolved if config file is found', function(done) {
    var config = path.resolve(__dirname, 'fixture/hosts.cfg');
    var promise = control._loadConfig('ejabberdctl', config);

    promise.then(function(stdout) { setTimeout(done, 0);},
                 function(reason) {
                   //setTimeout(done, 0);
                 });
  }); 

});
{'fraction_non_alphanumeric': 0.15640906987505784, 'fraction_numerical': 0.0037019898195279964, 'mean_word_length': 2.3364197530864197, 'pattern_counts': {'":': 0, '<': 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': '5248342', 'n_tokens_mistral': 619, 'n_tokens_neox': 600, 'n_words': 132}