public void before_all()
        {
            // setup
            _command = new NewCommand();
            _fileSystem = new FileSystem();
            _zipService = new ZipFileService(_fileSystem);
            _commandInput = new NewCommandInput();

            tmpDir = FileSystem.Combine("Templating", Guid.NewGuid().ToString());
            repoZip = FileSystem.Combine("Templating", "repo.zip");
            _zipService.ExtractTo(repoZip, tmpDir, ExplodeOptions.DeleteDestination);

            solutionFile = FileSystem.Combine("Templating", "sample", "myproject.txt");
            oldContents = _fileSystem.ReadStringFromFile(solutionFile);
            solutionDir = _fileSystem.GetDirectory(solutionFile);

            _commandInput.GitFlag = "file:///{0}".ToFormat(_fileSystem.GetFullPath(tmpDir).Replace("\\", "/"));
            _commandInput.ProjectName = "MyProject";
            _commandInput.SolutionFlag = solutionFile;
            _commandInput.OutputFlag = solutionDir;
            _commandInput.RakeFlag = "init.rb";

            _commandResult = _command.Execute(_commandInput);

            newSolutionContents = _fileSystem.ReadStringFromFile(solutionFile);
        }
        public void telling_solution_not_to_save_projects_should_not_save_projects()
        {
            var fileSystem = new FileSystem();
            var fullPathToHarnessProject = fileSystem.GetFullPath(@"SlickGridHarness\SlickGridHarness.csproj");

            var originalWriteTimestamp = new FileInfo(fullPathToHarnessProject).LastWriteTime;

            var solution = Solution.LoadFrom("FubuMVC.SlickGrid.sln");
            solution.Save(saveProjects: false);

            new FileInfo(fullPathToHarnessProject).LastWriteTime.ShouldEqual(originalWriteTimestamp);
        }
Example #3
0
		public FilePokeTask(string filePath, IList<FilePokeReplacement> replacements, FileSystem.Path path)
			: base(path)
		{
			_filePath = path.GetFullPath(filePath);
			_replacements = replacements;
		}