"use strict";
require("typings-test");
var smartstring = require("../dist/index");
var should = require("should");
describe("smartstring", function () {
describe(".Domain class", function () {
var testDomain;
it("should create a new Domain object", function () {
testDomain = new smartstring.Domain("level3D.level2D.level1D");
testDomain.should.be.instanceof(smartstring.Domain);
});
it("should have a .topLevel", function () {
testDomain.topLevel.should.equal("level1D");
});
it("should have a .level2", function () {
testDomain.level2.should.equal("level2D");
});
it("should have a .level3", function () {
testDomain.level3.should.equal("level3D");
});
});
describe(".Git class", function () {
var testGit;
it("should create a new Git class GitRepo", function () {
testGit = new smartstring.GitRepo("git+https://github.com/pushrocks/smartstring.git");
testGit.should.be.instanceof(smartstring.GitRepo);
});
it("should return a .host", function () {
testGit.host
.should.equal("github.com");
});
it("should return a .user", function () {
testGit.user
.should.equal("pushrocks");
});
it("should return a .repo", function () {
testGit.repo
.should.equal("smartstring");
});
it("should return a .httpsUrl", function () {
testGit.httpsUrl
.should.equal("https://github.com/pushrocks/smartstring.git");
});
it("should return a .sshUrl", function () {
testGit.sshUrl
.should.equal("git@github.com:pushrocks/smartstring.git");
});
});
describe(".docker", function () {
describe(".makeEnvObject", function () {
it("should create a Env Object", function () {
var envStringArray = ["VIRTUAL_HOST=sub.domain.tld", "DEFAULT_HOST=some.domain.com"];
var envObject = smartstring.docker.makeEnvObject(envStringArray);
envObject.VIRTUAL_HOST.should.equal("sub.domain.tld");
envObject.DEFAULT_HOST.should.equal("some.domain.com");
});
});
});
describe(".typescript", function () {
describe(".referenceRegex", function () {
it("should match reference paths", function () {
smartstring.typescript.regexReferencePath.test("/// ")
.should.be.true();
smartstring.typescript.regexReferencePath.test("/// ")
.should.be.true();
smartstring.typescript.regexReferencePath.test("/// ")
.should.be.false();
});
});
});
});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FDUCxDQUFDLENBRG9CO0FBQ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iKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSAuaHR0cHNVcmxcIixmdW5jdGlvbigpe1xyXG4gICAgICAgICAgICB0ZXN0R2l0Lmh0dHBzVXJsXHJcbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwiaHR0cHM6Ly9naXRodWIuY29tL3B1c2hyb2Nrcy9zbWFydHN0cmluZy5naXRcIik7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaXQoXCJzaG91bGQgcmV0dXJuIGEgLnNzaFVybFwiLGZ1bmN0aW9uKCl7XHJcbiAgICAgICAgICAgIHRlc3RHaXQuc3NoVXJsXHJcbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwiZ2l0QGdpdGh1Yi5jb206cHVzaHJvY2tzL3NtYXJ0c3RyaW5nLmdpdFwiKTtcclxuICAgICAgICB9KTtcclxuICAgIH0pXHJcbiAgICBkZXNjcmliZShcIi5kb2NrZXJcIixmdW5jdGlvbigpe1xyXG4gICAgICAgIGRlc2NyaWJlKFwiLm1ha2VFbnZPYmplY3RcIixmdW5jdGlvbigpe1xyXG4gICAgICAgICAgICBpdChcInNob3VsZCBjcmVhdGUgYSBFbnYgT2JqZWN0XCIsZnVuY3Rpb24oKXtcclxuICAgICAgICAgICAgICAgIGxldCBlbnZTdHJpbmdBcnJheSA9IFtcIlZJUlRVQUxfSE9TVD1zdWIuZG9tYWluLnRsZFwiLFwiREVGQVVMVF9IT1NUPXNvbWUuZG9tYWluLmNvbVwiXTtcclxuICAgICAgICAgICAgICAgIGxldCBlbnZPYmplY3QgPSBzbWFydHN0cmluZy5kb2NrZXIubWFrZUVudk9iamVjdChlbnZTdHJpbmdBcnJheSk7XHJcbiAgICAgICAgICAgICAgICBlbnZPYmplY3QuVklSVFVBTF9IT1NULnNob3VsZC5lcXVhbChcInN1Yi5kb21haW4udGxkXCIpO1xyXG4gICAgICAgICAgICAgICAgZW52T2JqZWN0LkRFR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