"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = require("chai");
var _1 = require(".");
describe('command', function () {
    it('starts with no value', function () {
        var cmd = _1.command();
        chai_1.expect(cmd.value).to.eql('');
        chai_1.expect(cmd.toString()).to.eql('');
    });
    it('starts with a base value (string)', function () {
        var cmd = _1.command('foo');
        chai_1.expect(cmd.value).to.eql('foo');
        chai_1.expect(cmd.toString()).to.eql('foo');
    });
    it('starts with a base value (Command)', function () {
        var base = _1.command('foo').arg('force');
        var cmd = _1.command(base);
        chai_1.expect(cmd.value).to.eql('foo --force');
        chai_1.expect(cmd.toString()).to.eql('foo --force');
    });
    it('adds an argument', function () {
        chai_1.expect(_1.command('run').arg('force').value).to.eql('run --force');
        chai_1.expect(_1.command('run').arg('--force').value).to.eql('run --force');
        chai_1.expect(_1.command('run').arg('---force').value).to.eql('run --force');
        chai_1.expect(_1.command('run').arg('-force').value).to.eql('run --force');
        chai_1.expect(_1.command('run').arg(' --force  ').value).to.eql('run --force');
        chai_1.expect(_1.command('run').arg('   -force  ').value).to.eql('run --force');
    });
    it('adds an argument (alias)', function () {
        chai_1.expect(_1.command('run').alias('f').value).to.eql('run -f');
        chai_1.expect(_1.command('run').alias('-f').value).to.eql('run -f');
        chai_1.expect(_1.command('run').alias('--f').value).to.eql('run -f');
        chai_1.expect(_1.command('run').alias(' -f  ').value).to.eql('run -f');
        chai_1.expect(_1.command('run').alias(' --f  ').value).to.eql('run -f');
    });
    it('adds a new-line', function () {
        var cmd = _1.command('cd ./dir')
            .newLine()
            .add('run');
        chai_1.expect(cmd.toString()).to.eql("cd ./dir\nrun");
    });
    it('adds a command as a new-line', function () {
        var cmd = _1.command()
            .addLine('cd ./dir')
            .addLine('run');
        chai_1.expect(cmd.toString()).to.eql("cd ./dir\nrun\n");
    });
    it('does not add values (include = false)', function () {
        var cmd = _1.command()
            .add('foo', false)
            .addLine('bar', false)
            .newLine(false)
            .arg('force', false)
            .alias('f', false);
        chai_1.expect(cmd.toString()).to.eql('');
    });
    it('is immutable', function () {
        var cmd1 = _1.command();
        var cmd2 = cmd1.add('foo');
        var cmd3 = cmd2.arg('force');
        var cmd4 = cmd3.alias('c');
        var cmd5 = cmd4.newLine();
        var cmd6 = cmd5.addLine('cd bar');
        chai_1.expect(cmd2).to.not.equal(cmd1);
        chai_1.expect(cmd3).to.not.equal(cmd2);
        chai_1.expect(cmd4).to.not.equal(cmd3);
        chai_1.expect(cmd5).to.not.equal(cmd4);
        chai_1.expect(cmd6).to.not.equal(cmd5);
    });
});
//# sourceMappingURL=command.TEST.js.map