<commit_before>var helper = require('./helper'),
    assert = helper.assert,
    debug = helper.debug;

var Serializer = require('..'),
    serializer = new Serializer();

// -----------------------
//  Test
// --------------------

module.exports = {

  'Serializer': {
    'new': {
      '()': function() {
        assert.instanceOf ( serializer, require('..') );

        Serializer.reset();

        var serializer2 = new Serializer();

        assert.typeOf ( serializer2.options, 'object' );
        assert.deepEqual ( serializer2.options.custom, undefined );
      },

      '(options)': function() {
        Serializer.reset();

        var serializer2 = new Serializer({custom: {foo: 'bar'}});

        assert.equal ( serializer2.url, null );
        assert.typeOf ( serializer2.options, 'object' );
        assert.deepEqual ( serializer2.options.custom, {foo: 'bar'} );
      }
    },

    '.klass': function() {
      assert.property ( serializer, 'klass' );
      assert.equal ( serializer.klass, Serializer );
    },

    '.name': function() {
      assert.property ( Serializer, 'name' );
      assert.equal ( Serializer.name, 'Serializer' );
    },

    '.defaults': function() {
      assert.property ( Serializer, 'defaults' );

      assert.typeOf ( Serializer.defaults.options, 'object' );
    },

    '.options': function() {
      assert.property ( Serializer, 'options' );
      assert.typeOf ( Serializer.options, 'null' );
    },

    '.reset()': function() {
      assert.property ( Serializer, 'reset' );
      assert.typeOf ( Serializer.reset, 'function' );

      Serializer.options = {foo: "bar"};
      assert.deepEqual ( Serializer.options, {foo: "bar"} );
      assert.deepEqual ( Serializer.defaults.options, {} );

      Serializer.reset();

      assert.equal ( Serializer.options, Serializer.defaults.options );
    }
  },

  'Serializer.prototype': {
    '.name': function() {
      assert.property ( serializer, 'name' );
      assert.equal ( serializer.name, 'Serializer' );
    },

    '#options': function() {
      assert.property ( serializer, 'options' );
      assert.typeOf ( serializer.options, 'object' );
    },

    '#engine': function() {
      assert.property ( serializer, 'engine' );
      assert.typeOf ( serializer.engine, 'null' );
    },

    '#binary': function() {
      assert.property ( serializer, 'binary' );
      assert.typeOf ( serializer.binary, 'boolean' );
      assert.equal ( serializer.binary, false );
    },

    '#serialize': function() {
      assert.property ( serializer, 'serialize' );
      assert.typeOf ( serializer.serialize, 'function' );
      assert.throws ( serializer.serialize, Error );
    },

    '#deserialize': function() {
      assert.property ( serializer, 'deserialize' );
      assert.typeOf ( serializer.deserialize, 'function' );
      assert.throws ( serializer.deserialize, Error );
    }
  }

};<commit_msg>Init.<commit_after>var helper = require('./helper'),
    assert = helper.assert,
    debug = helper.debug;

var Compressor = require('..'),
    compressor = new Compressor();

// -----------------------
//  Test
// --------------------

module.exports = {

  'Compressor': {
    'new': {
      '()': function() {
        assert.instanceOf ( compressor, require('..') );

        Compressor.reset();

        var compressor2 = new Compressor();

        assert.typeOf ( compressor2.options, 'object' );
        assert.deepEqual ( compressor2.options.custom, undefined );
      },

      '(options)': function() {
        Compressor.reset();

        var compressor2 = new Compressor({custom: {foo: 'bar'}});

        assert.equal ( compressor2.url, null );
        assert.typeOf ( compressor2.options, 'object' );
        assert.deepEqual ( compressor2.options.custom, {foo: 'bar'} );
      }
    },

    '.klass': function() {
      assert.property ( compressor, 'klass' );
      assert.equal ( compressor.klass, Compressor );
    },

    '.name': function() {
      assert.property ( Compressor, 'name' );
      assert.equal ( Compressor.name, 'Compressor' );
    },

    '.defaults': function() {
      assert.property ( Compressor, 'defaults' );

      assert.typeOf ( Compressor.defaults.options, 'object' );
    },

    '.options': function() {
      assert.property ( Compressor, 'options' );
      assert.typeOf ( Compressor.options, 'null' );
    },

    '.reset()': function() {
      assert.property ( Compressor, 'reset' );
      assert.typeOf ( Compressor.reset, 'function' );

      Compressor.options = {foo: "bar"};
      assert.deepEqual ( Compressor.options, {foo: "bar"} );
      assert.deepEqual ( Compressor.defaults.options, {} );

      Compressor.reset();

      assert.equal ( Compressor.options, Compressor.defaults.options );
    }
  },

  'Compressor.prototype': {
    '.name': function() {
      assert.property ( compressor, 'name' );
      assert.equal ( compressor.name, 'Compressor' );
    },

    '#options': function() {
      assert.property ( compressor, 'options' );
      assert.typeOf ( compressor.options, 'object' );
    },

    '#engine': function() {
      assert.property ( compressor, 'engine' );
      assert.typeOf ( compressor.engine, 'null' );
    },

    '#binary': function() {
      assert.property ( compressor, 'binary' );
      assert.typeOf ( compressor.binary, 'boolean' );
      assert.equal ( compressor.binary, false );
    },

    '#compress': function() {
      assert.property ( compressor, 'compress' );
      assert.typeOf ( compressor.compress, 'function' );
      assert.throws ( compressor.compress, Error );
    },

    '#decompress': function() {
      assert.property ( compressor, 'decompress' );
      assert.typeOf ( compressor.decompress, 'function' );
      assert.throws ( compressor.decompress, Error );
    }
  }

};
{'fraction_non_alphanumeric': 0.17826386496727523, 'fraction_numerical': 0.002411298656562177, 'mean_word_length': 2.464797136038186, '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': '4282206', 'n_tokens_mistral': 1726, 'n_tokens_neox': 1643, 'n_words': 324}