<commit_before>
var should = require( 'should' ),
    flick = require( '..' );

describe( 'flick()', function() {
  it( 'should return a function with "handle", "use", "repository" and "stack" properties', function() {
    var handler = flick();
    handler.should.be.a( 'function' ).with.lengthOf( 3 );
    handler.should.have.property( 'handle' );
    handler.should.have.property( 'use' );
    handler.should.have.property( 'repository' );
    handler.should.have.property( 'stack' );
  } );
  describe( 'handler.use()', function() {
    it( 'should be a function and take 2 arguments', function() {
      var handler = flick();
      handler.use.should.be.a( 'function' ).with.lengthOf( 2 );
    } );
    it( 'should populate the stack', function() {
      var handler = flick(),
          fn = function() {};
      handler.use( 'repo_name', fn );
      handler.stack[ 0 ].should.be.a( 'object' );
      handler.stack[ 0 ].should.have.property( 'repository' );
      handler.stack[ 0 ].should.have.property( 'handle' );
      handler.stack[ 0 ].repository.should.be.equal( 'repo_name' );
      handler.stack[ 0 ].handle.should.be.equal( fn );
    } );
    it( 'should accept only a function', function() {
      var handler = flick(),
          fn = function() {};
      handler.use( fn );
      handler.stack[ 0 ].should.be.a( 'object' );
      handler.stack[ 0 ].should.have.property( 'repository' );
      handler.stack[ 0 ].should.have.property( 'handle' );
      handler.stack[ 0 ].repository.should.be.equal( '*' );
      handler.stack[ 0 ].handle.should.be.equal( fn );
    } );
  } );
  describe( 'handler.handle()', function() {
    function _req( owner, repo ) {
      return {
        payload: {
          repository: {
            owner: { name: owner },
            name: repo<commit_msg>More descriptive tests titles.<commit_after>
var should = require( 'should' ),
    flick = require( '..' );

describe( 'flick()', function() {
  it( 'should return a function with "handle", "use", "repository" and "stack" properties', function() {
    var handler = flick();
    handler.should.be.a( 'function' ).with.lengthOf( 3 );
    handler.should.have.property( 'handle' );
    handler.should.have.property( 'use' );
    handler.should.have.property( 'repository' );
    handler.should.have.property( 'stack' );
  } );
  describe( 'handler.use( repository, fn )', function() {
    it( 'should be a function and take 2 arguments', function() {
      var handler = flick();
      handler.use.should.be.a( 'function' ).with.lengthOf( 2 );
    } );
    it( 'should populate the stack', function() {
      var handler = flick(),
          fn = function() {};
      handler.use( 'repo_name', fn );
      handler.stack[ 0 ].should.be.a( 'object' );
      handler.stack[ 0 ].should.have.property( 'repository' );
      handler.stack[ 0 ].should.have.property( 'handle' );
      handler.stack[ 0 ].repository.should.be.equal( 'repo_name' );
      handler.stack[ 0 ].handle.should.be.equal( fn );
    } );
    it( 'should accept only a function', function() {
      var handler = flick(),
          fn = function() {};
      handler.use( fn );
      handler.stack[ 0 ].should.be.a( 'object' );
      handler.stack[ 0 ].should.have.property( 'repository' );
      handler.stack[ 0 ].should.have.property( 'handle' );
      handler.stack[ 0 ].repository.should.be.equal( '*' );
      handler.stack[ 0 ].handle.should.be.equal( fn );
    } );
  } );
  describe( 'handler.handle( req, res, next )', function() {
    function _req( owner, repo ) {
      return {
        payload: {
          repository: {
            owner: { name: owner },
            name: repo
{'fraction_non_alphanumeric': 0.17655097021044, 'fraction_numerical': 0.007105766602896966, 'mean_word_length': 2.623762376237624, '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': '3549623', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1125, 'n_words': 287}