Пример #1
0
        public void ShouldPerformSubstitutions()
        {
            string substitutionTarget = Path.Combine("subFolder", "config.json");

            fileSystem.EnumerateFiles(StagingDirectory, substitutionTarget).Returns(new[] { Path.Combine(StagingDirectory, substitutionTarget) });

            variables.Set(SpecialVariables.Package.SubstituteInFilesTargets, substitutionTarget);
            variables.Set(SpecialVariables.Package.SubstituteInFilesEnabled, true.ToString());

            CreateConvention().Install(deployment);

            substituter.Received().PerformSubstitution(Path.Combine(StagingDirectory, substitutionTarget), variables);
        }
Пример #2
0
        public void ShouldPerformSubstitutions()
        {
            string glob        = "**\\*config.json";
            string actualMatch = "config.json";

            fileSystem.EnumerateFilesWithGlob(StagingDirectory, glob).Returns(new[] { Path.Combine(StagingDirectory, actualMatch) });

            variables.Set(SpecialVariables.Package.SubstituteInFilesTargets, glob);
            variables.Set(SpecialVariables.Package.SubstituteInFilesEnabled, true.ToString());

            CreateConvention().Install(deployment);

            substituter.Received().PerformSubstitution(Path.Combine(StagingDirectory, actualMatch), variables);
        }