<commit_before>"use strict"

var closured = require("../index.js")
  , sinon = require("sinon")
  , assert = require("assert")

var compiler
beforeEach(function () {
    compiler = new closured.Compiler()
})

function runClosureCommandLineMockSuccess (args, cb) {
    setImmediate(cb(null))
}

describe("#compile", function () {
    var runner
    beforeEach(function () {
        runner = sinon.spy(runClosureCommandLineMockSuccess)
        compiler.setClosureCommandLineRunner(runner)
    })

    it("should call the provided runClosureCommandLine function", function (done) {
        compiler.compile(null, done)
    })
})

<commit_msg>Making better use of Sinon.<commit_after>"use strict"

var closured = require("../index.js")
  , sinon = require("sinon")
  , assert = require("assert")

var compiler
beforeEach(function () {
    compiler = new closured.Compiler()
})

describe("#compile", function () {
    var runner
    beforeEach(function () {
        runner = sinon.expectation.create("closureCommandLineRunner")
        runner.callsArgWithAsync(1, null)  // Call the callback with null
        compiler.setClosureCommandLineRunner(runner)
    })

    it("should call the provided runClosureCommandLine function", function (done) {
        runner.once()
        compiler.compile(null, done)
    })
})


{'fraction_non_alphanumeric': 0.12652439024390244, 'fraction_numerical': 0.0007621951219512195, 'mean_word_length': 3.6725978647686834, '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': '4700913', 'n_tokens_mistral': 388, 'n_tokens_neox': 376, 'n_words': 83}