Ejemplo n.º 1
0
        public void GivenDefaultToolDoNotExist()
        {
            var toolPath = new FilePath("/Working/tools/GitReleaseManager.exe");

            FileSystem.EnsureFileDoNotExist(toolPath);
            GitReleaseManagerToolResolver.ResolvePath().Returns("/NonWorking/tools/GitReleaseManager.exe");
        }
Ejemplo n.º 2
0
        protected GitReleaseManagerFixture()
        {
            Environment = FakeEnvironment.CreateUnixEnvironment();

            Process = Substitute.For <IProcess>();
            Process.GetExitCode().Returns(0);
            ProcessRunner = Substitute.For <IProcessRunner>();
            ProcessRunner.Start(Arg.Any <FilePath>(), Arg.Any <ProcessSettings>()).Returns(Process);

            Globber = Substitute.For <IGlobber>();
            Globber.Match("./tools/**/gitreleasemanager.exe").Returns(new[] { (FilePath)"/Working/tools/GitReleaseManager.exe" });
            Globber.Match("./tools/**/GitReleaseManager.exe").Returns(new[] { (FilePath)"/Working/tools/GitReleaseManager.exe" });

            GitReleaseManagerToolResolver = Substitute.For <IGitReleaseManagerToolResolver>();

            Log        = Substitute.For <ICakeLog>();
            FileSystem = new FakeFileSystem(Environment);

            // By default, there is a default tool.
            GitReleaseManagerToolResolver.ResolvePath().Returns("/Working/tools/GitReleaseManager.exe");
            FileSystem.CreateFile("/Working/tools/GitReleaseManager.exe");

            // Set standard output.
            Process.GetStandardOutput().Returns(new string[0]);
        }