Exemplo n.º 1
0
            public void Should_set_show_parameter()
            {
                var fixture = new TerraformShowFixture();

                var result = fixture.Run();

                Assert.Contains("show", result.Args);
            }
Exemplo n.º 2
0
            public void Should_find_linux_executable()
            {
                var fixture = new TerraformShowFixture(PlatformFamily.Linux);

                var result = fixture.Run();

                Assert.Equal("/Working/tools/terraform", result.Path.FullPath);
            }
Exemplo n.º 3
0
            public void Should_find_terraform_if_tool_path_not_provided()
            {
                var fixture = new TerraformShowFixture();

                var result = fixture.Run();

                Assert.Equal("/Working/tools/terraform.exe", result.Path.FullPath);
            }
Exemplo n.º 4
0
            public void Should_set_plan_file_parameter()
            {
                var fixture = new TerraformShowFixture {
                    Settings = { PlanFile = "./input/myplan.plan" }
                };

                var result = fixture.Run();

                Assert.Contains(fixture.Settings.PlanFile.FullPath, result.Args);
            }
Exemplo n.º 5
0
            public void Should_redirect_stdout_to_file_if_set()
            {
                var fixture = new TerraformShowFixture {
                    Settings = { OutFile = "./output.txt" }
                };

                var result = fixture.Run();

                Assert.True(result.Process.RedirectStandardOutput);
                Assert.Equal(fixture.ProcessRunner.Process.GetStandardOutput(), File.ReadAllLines(fixture.Settings.OutFile.FullPath));
            }
Exemplo n.º 6
0
            public void Should_throw_if_terraform_runner_was_not_found()
            {
                var fixture = new TerraformShowFixture();

                fixture.GivenDefaultToolDoNotExist();

                var result = Record.Exception(() => fixture.Run());

                Assert.IsType <CakeException>(result);
                Assert.Equal("Terraform: Could not locate executable.", result.Message);
            }
Exemplo n.º 7
0
            public void Should_use_terraform_from_tool_path_if_provided(string toolPath, string expected)
            {
                var fixture = new TerraformShowFixture {
                    Settings = { ToolPath = toolPath }
                };

                fixture.GivenSettingsToolPathExist();

                var result = fixture.Run();

                Assert.Equal(expected, result.Path.FullPath);
            }