Skip to content

Commit

Permalink
Updating summary and adding a test
Browse files Browse the repository at this point in the history
  • Loading branch information
sergJozee committed Jan 12, 2023
1 parent dfed333 commit 0340bbd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Cake.Terraform.Tests/TerraformApplyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@ public void Should_Append_Auto_Approve_When_AutoApprove_Is_True()
Assert.Contains("-auto-approve", result.Args);
}

[Fact]
public void Should_Append_Destroy_When_AutoApprove_Is_True()
{
var fixture = new Fixture
{
Settings = new TerraformApplySettings
{
Destroy = true
}
};

var result = fixture.Run();

Assert.Contains("-destroy", result.Args);
}

[Fact]
public void Should_set_plan_path()
{
Expand Down
3 changes: 2 additions & 1 deletion src/Cake.Terraform/Apply/TerraformApplySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class TerraformApplySettings : TerraformSettings
public bool AutoApprove { get; set; }

/// <summary>
/// Does destory
/// Using the apply for destroying the terraform resources
/// https://developer.hashicorp.com/terraform/cli/commands/destroy
/// </summary>
public bool Destroy { get; set; }
}
Expand Down

0 comments on commit 0340bbd

Please sign in to comment.