Sha256: 127464b752f158d59460119440b35a3fec616baa7e2f5e4d25e040b8fff0b28d

Contents?: true

Size: 1.59 KB

Versions: 18

Compression:

Stored size: 1.59 KB

Contents

buster.testCase("URL", {
    "templatize": {
        "returns only path": function () {
            var url = gts.url.templatize("http://localhost:3000/", {
                ref: "master"
            });
            assert.equals(url, "/");
        },

        "replaces matched value with template token": function () {
            var url = gts.url.templatize("http://localhost:3000/master/", {
                ref: "master"
            });

            assert.equals(url, "/#{ref}/");
        },

        "replaces all occurrences of value": function () {
            var url = gts.url.templatize("http://localhost:3000/master/some/master", {
                ref: "master"
            });

            assert.equals(url, "/#{ref}/some/#{ref}");
        },

        "replaces all values": function () {
            var url = gts.url.templatize("http://localhost:3000/master:lib/file.js", {
                ref: "master",
                path: "lib/file.js"
            });

            assert.equals(url, "/#{ref}:#{path}");
        }
    },

    "currentRef": {
        "extracts master from tree URL": function () {
            var ref = gts.url.currentRef("http://localhost/tree/master:lib");
            assert.equals(ref, "master");
        },

        "does not fail when no ref": function () {
            var ref = gts.url.currentRef("http://localhost/");
            assert.isNull(ref);
        },

        "extracts ref with slashes": function () {
            var ref = gts.url.currentRef("http://localhost/blob/refs/heads/something:");
            assert.equals(ref, "refs/heads/something");
        }
    }
});

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dolt-0.13.0 vendor/ui/test/url-template-test.js
dolt-0.12.0 vendor/ui/test/url-template-test.js
dolt-0.11.0 vendor/ui/test/url-template-test.js
dolt-0.10.0 vendor/ui/test/url-template-test.js
dolt-0.9.0 vendor/ui/test/url-template-test.js
dolt-0.8.0 vendor/ui/test/url-template-test.js
dolt-0.7.1 vendor/ui/test/url-template-test.js
dolt-0.7.0 vendor/ui/test/url-template-test.js
dolt-0.6.2 vendor/ui/test/url-template-test.js
dolt-0.6.1 vendor/ui/test/url-template-test.js
dolt-0.6.0 vendor/ui/test/url-template-test.js
dolt-0.5.1 vendor/ui/test/url-template-test.js
dolt-0.5.0 vendor/ui/test/url-template-test.js
dolt-0.4.3 vendor/ui/test/url-template-test.js
dolt-0.4.2 vendor/ui/test/url-template-test.js
dolt-0.4.1 vendor/ui/test/url-template-test.js
dolt-0.4.0 vendor/ui/test/url-template-test.js
dolt-0.3.1 vendor/ui/test/url-template-test.js