Merge pull request #1771 from hashicorp/b-fix-acctest

helper/resource/testing: unit tests to cover #1770
This commit is contained in:
Paul Hinze 2015-05-01 12:38:06 -05:00
commit 8d953eae82
2 changed files with 6 additions and 2 deletions

View File

@ -266,7 +266,8 @@ func testStep(
}
}
return state, err
// Made it here? Good job test step!
return state, nil
}
// ComposeTestCheckFunc lets you compose multiple TestCheckFuncs into

View File

@ -165,7 +165,10 @@ func TestTest_stepError(t *testing.T) {
if !mt.failed() {
t.Fatal("test should've failed")
}
t.Logf("Fail message: %s", mt.failMessage())
expected := "Step 0 error: Check failed: error"
if mt.failMessage() != expected {
t.Fatalf("Expected message: %s\n\ngot:\n\n%s", expected, mt.failMessage())
}
if !checkDestroy {
t.Fatal("didn't call check for destroy")