Exemplo n.º 1
0
        public void WhenOnlyPathIsSet_CommandLineIsCorrect()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings(),
                Path     = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build path"));
        }
        public void WhenPathIsQuoted_ArgumentIsNotDoubleQuoted(string path)
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings(),
                Path     = path
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo($"build {path}"));
        }
        public void WhenPathHasSingleQuote_ArgumentIsQuoted()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings(),
                Path     = "\""
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo(@"build """""""));
        }
Exemplo n.º 4
0
        public void WhenPullFlagIsSetToTrue_CommandLineDoesHavePull()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings {
                    Pull = true
                },
                Path = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build --pull path"));
        }
Exemplo n.º 5
0
        public void WhenForceRmFlagIsSetToFalse_CommandLineDoesNotHaveForceRm()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings {
                    ForceRm = false
                },
                Path = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build path"));
        }
Exemplo n.º 6
0
        public void WhenRmFlagIsSet_CommandLineIsCorrect()
        {
            var fixture = new DockerBuildFixture
            {
                Settings = new DockerImageBuildSettings {
                    Rm = true
                },
                Path = "path"
            };

            var actual = fixture.Run();

            Assert.That(actual.Args, Is.EqualTo("build --rm path"));
        }