diff --git a/source/dub/dub.d b/source/dub/dub.d index a36ac53..871df0f 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -368,15 +368,15 @@ import dub.test.base : TestDub; scope (exit) environment.remove("DUB_REGISTRY"); - auto dub = new TestDub(".", null, SkipPackageSuppliers.configured); + auto dub = new TestDub(null, ".", null, SkipPackageSuppliers.configured); assert(dub.packageSuppliers.length == 0); environment["DUB_REGISTRY"] = "http://example.com/"; - dub = new TestDub(".", null, SkipPackageSuppliers.configured); + dub = new TestDub(null, ".", null, SkipPackageSuppliers.configured); assert(dub.packageSuppliers.length == 1); environment["DUB_REGISTRY"] = "http://example.com/;http://foo.com/"; - dub = new TestDub(".", null, SkipPackageSuppliers.configured); + dub = new TestDub(null, ".", null, SkipPackageSuppliers.configured); assert(dub.packageSuppliers.length == 2); - dub = new TestDub(".", [new RegistryPackageSupplier(URL("http://bar.com/"))], SkipPackageSuppliers.configured); + dub = new TestDub(null, ".", [new RegistryPackageSupplier(URL("http://bar.com/"))], SkipPackageSuppliers.configured); assert(dub.packageSuppliers.length == 3); dub = new TestDub(); @@ -1648,7 +1648,7 @@ import dub.test.base : TestDub; import std.path: buildPath, absolutePath; - auto dub = new TestDub(".", null, SkipPackageSuppliers.configured); + auto dub = new TestDub(null, ".", null, SkipPackageSuppliers.configured); immutable olddc = environment.get("DC", null); immutable oldpath = environment.get("PATH", null); immutable testdir = "test-determineDefaultCompiler"; diff --git a/source/dub/test/base.d b/source/dub/test/base.d index 5d6a81a..44b241f 100644 --- a/source/dub/test/base.d +++ b/source/dub/test/base.d @@ -181,15 +181,6 @@ cache: Root ~ "user/" ~ "cache/", }; - /// Forward to base constructor - public this (string root = ProjectPath.toNativeString(), - PackageSupplier[] extras = null, - SkipPackageSuppliers skip = SkipPackageSuppliers.none) - { - this.fs = new FSEntry(); - super(root, extras, skip); - } - /*************************************************************************** Instantiate a new `TestDub` instance with the provided filesystem state @@ -200,14 +191,20 @@ Params: dg = Delegate to be called with the filesystem, before `TestDub` instantiation is performed; + root = The root path for this instance (forwarded to Dub) + extras = Extras `PackageSupplier`s (forwarded to Dub) + skip = What `PackageSupplier`s to skip (forwarded to Dub) ***************************************************************************/ - public this (scope void delegate(scope FSEntry root) dg) + public this (scope void delegate(scope FSEntry root) dg = null, + string root = ProjectPath.toNativeString(), + PackageSupplier[] extras = null, + SkipPackageSuppliers skip = SkipPackageSuppliers.none) { this.fs = new FSEntry(); - dg(this.fs); - super(ProjectPath.toNativeString(), null, SkipPackageSuppliers.none); + if (dg !is null) dg(this.fs); + super(root, extras, skip); } /// Avoid loading user configuration