<commit_before>/*
 * grunt-version-file
 * https://github.com/cfogelberg/grunt-version-file
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

"use strict";

describe("VersionFileWriter", function() {
  it.skip("has a write_file method", function() {
  });

  it.skip("write_file requires options.json_creator", function() {
  });
});
<commit_msg>VersionFileWriter - tests<commit_after>/*
 * grunt-version-file
 * https://github.com/cfogelberg/grunt-version-file
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */
// Allow indirectly-executed (should-executed) function literals to pass jshint IIFE warning:
/*jshint -W068 */
// Allow expressions (...should.be.a.Foo;)
/*jshint -W030 */

"use strict";

describe("VersionFileWriter", function() {
  var GeneratorManager = require("../../lib/generator_manager");
  var JsonCreator = require("../../lib/json_creator");
  var VersionFileWriter = require("../../lib/version_file_writer");

  var JSON_CREATOR_VALID = new JsonCreator({
    generator_manager: new GeneratorManager({
      generator_dir: "generators",
      generator_list: ["datestring", "npm_version"]
    })
  });
  var OUT_VALID = "build/out/version.json";

  var VALID_OPTIONS = {
    json_creator: JSON_CREATOR_VALID,
    out: OUT_VALID
  };

  it("has a write_version_file method", function() {
    var vfw = new VersionFileWriter();
    vfw.write_version_file.should.be.a.Function;
    typeof(vfw.write_version_file).should.be.a.Function;
  });

  it("write_version_file requires options.json_object_creator", function() {
    var vfw = new VersionFileWriter();
    (function() {
      vfw.write_version_file({
        out: OUT_VALID
      });
    }).should.throw();
  });

  it("write_version_file requires options.out", function() {
    var vfw = new VersionFileWriter();
    (function() {
      vfw.write_version_file({
        json_creator: JSON_CREATOR_VALID
      });
    }).should.throw();
  });

  it("write_version_file requires options.out to be a string", function() {
    var vfw = new VersionFileWriter();
    (function() {
      vfw.write_version_file({
        json_creator: JSON_CREATOR_VALID,
        out: 1
      });
    }).should.throw();
  });

  it.skip("writes valid options correctly", function() {
    var vfw = new VersionFileWriter();
    vfw.write_version_file(VALID_OPTIONS);
    // TODO: After write is completed, test that written file matches expected string
  });
});

{'fraction_non_alphanumeric': 0.14646053702196907, 'fraction_numerical': 0.006102522375915379, 'mean_word_length': 3.5119266055045872, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6186071', 'n_tokens_mistral': 800, 'n_tokens_neox': 771, 'n_words': 167}