terraform: ShadowError returns errors, not the close operation

This commit is contained in:
Mitchell Hashimoto 2016-10-08 16:58:00 +08:00
parent d30cfef4d2
commit e2fc0b518f
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 15 additions and 6 deletions

View File

@ -114,8 +114,11 @@ func TestShadowResourceProviderInput_badInput(t *testing.T) {
}
// Verify we have an error
if err := shadow.CloseShadow(); err == nil {
t.Fatal("should have error")
if err := shadow.CloseShadow(); err != nil {
t.Fatalf("bad: %s", err)
}
if err := shadow.ShadowError(); err == nil {
t.Fatal("should error")
}
}
@ -194,8 +197,11 @@ func TestShadowResourceProviderValidate_badInput(t *testing.T) {
shadow.Validate(configBad)
// Verify we have an error
if err := shadow.CloseShadow(); err == nil {
t.Fatal("should have error")
if err := shadow.CloseShadow(); err != nil {
t.Fatalf("bad: %s", err)
}
if err := shadow.ShadowError(); err == nil {
t.Fatal("should error")
}
}
@ -265,8 +271,11 @@ func TestShadowResourceProviderConfigure_badInput(t *testing.T) {
shadow.Configure(configBad)
// Verify we have an error
if err := shadow.CloseShadow(); err == nil {
t.Fatal("should have error")
if err := shadow.CloseShadow(); err != nil {
t.Fatalf("bad: %s", err)
}
if err := shadow.ShadowError(); err == nil {
t.Fatal("should error")
}
}