Merge pull request #1771 from hashicorp/b-fix-acctest
helper/resource/testing: unit tests to cover #1770
This commit is contained in:
commit
8d953eae82
|
@ -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
|
// ComposeTestCheckFunc lets you compose multiple TestCheckFuncs into
|
||||||
|
|
|
@ -165,7 +165,10 @@ func TestTest_stepError(t *testing.T) {
|
||||||
if !mt.failed() {
|
if !mt.failed() {
|
||||||
t.Fatal("test should've 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 {
|
if !checkDestroy {
|
||||||
t.Fatal("didn't call check for destroy")
|
t.Fatal("didn't call check for destroy")
|
||||||
|
|
Loading…
Reference in New Issue