2016-02-23 06:06:54 +00:00
|
|
|
/// <reference path="../ts/typings/main.d.ts" />
|
|
|
|
var smartstring = require("../dist/index.js");
|
|
|
|
var should = require("should");
|
|
|
|
describe("smartstring", function () {
|
|
|
|
describe(".git()", function () {
|
|
|
|
var testGit = smartstring.git("git+https://github.com/pushrocks/smartstring.git");
|
|
|
|
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");
|
|
|
|
});
|
|
|
|
});
|
2016-04-15 22:58:44 +00:00
|
|
|
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");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2016-02-23 06:06:54 +00:00
|
|
|
});
|
2016-04-15 22:58:44 +00:00
|
|
|
|
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksV0FBVyxH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gICB0ZXN0R2l0Lmhvc3RcbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwiZ2l0aHViLmNvbVwiKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGl0KFwic2hvdWxkIHJldHVybiBhIC51c2VyXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIHRlc3RHaXQudXNlclxuICAgICAgICAgICAgICAgIC5zaG91bGQuZXF1YWwoXCJwdXNocm9ja3NcIik7XG4gICAgICAgIH0pO1xuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSAucmVwb1wiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICB0ZXN0R2l0LnJlcG9cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwic21hcnRzdHJpbmdcIik7XG4gICAgICAgIH0pO1xuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSAuaHR0cHNVcmxcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgdGVzdEdpdC5odHRwc1VybFxuICAgICAgICAgICAgICAgIC5zaG91bGQuZXF1YWwoXCJodHRwczovL2dpdGh1Yi5jb20vcHVzaHJvY2tzL3NtYXJ0c3RyaW5nLmdpdFwiKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGl0KFwic2hvdWxkIHJldHVybiBhIC5zc2hVcmxcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgdGVzdEdpdC5zc2hVcmxcbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwiZ2l0QGdpdGh1Yi5jb206cHVzaHJvY2tzL3NtYXJ0c3RyaW5nLmdpdFwiKTtcbiAgICAgICAgfSk7XG4gICAgfSlcbiAgICBkZXNjcmliZShcIi5kb2NrZXJcIixmdW5jdGlvbigpe1xuICAgICAgICBkZXNjcmliZShcIi5tYWtlRW52T2JqZWN0XCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIGl0KFwic2hvdWxkIGNyZWF0ZSBhIEVudiBPYmplY3RcIixmdW5jdG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