Skip to content

Commit

Permalink
Merge pull request hashicorp#1771 from hashicorp/b-fix-acctest
Browse files Browse the repository at this point in the history
helper/resource/testing: unit tests to cover hashicorp#1770
  • Loading branch information
phinze committed May 1, 2015
2 parents 5d07394 + 88744d5 commit 8d953ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion helper/resource/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion helper/resource/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8d953ea

Please sign in to comment.