UNPKG

create-readme

Version:

Automatically creates README.md based on package.json and other existing files.

44 lines (39 loc) 1.92 kB
// Generated by CoffeeScript 2.3.2 (function() { var DescriptionParser, os; DescriptionParser = require('../components/description.coffee'); os = require('os'); describe("A DescriptionParser", function() { var pkg; pkg = null; beforeEach(function() { pkg = require('../../package.json'); return pkg.git = { user: "dbartholomae", repo: "readme-creator", branch: "master" }; }); it("should parse the description from package.json correctly", function() { var descriptionParser; descriptionParser = new DescriptionParser(); return expect(descriptionParser.run(pkg)).to.eventually.equal("Automatically creates README.md based " + "on package.json and other existing files."); }); it("should accept an addition to the description as a String", function() { var addDesc, descriptionParser; addDesc = "And it uses its own package.json for testing, which definitely isn't good!"; descriptionParser = new DescriptionParser({ addDesc: addDesc }); return expect(descriptionParser.run(pkg)).to.eventually.equal("Automatically creates README.md based " + "on package.json and other existing files." + os.EOL + os.EOL + "And it uses its own package.json for testing, which definitely isn't good!"); }); return it("should accept an addition to the description as an array", function() { var addDesc, descriptionParser; addDesc = ["And it uses its own package.json ", "for testing, which definitely isn't good!"]; descriptionParser = new DescriptionParser({ addDesc: addDesc }); return expect(descriptionParser.run(pkg)).to.eventually.equal("Automatically creates README.md based " + "on package.json and other existing files." + os.EOL + os.EOL + "And it uses its own package.json for testing, which definitely isn't good!"); }); }); }).call(this);