helper/resource: Consolidate unit test override

I noticed we had two mechanisms for unit test override. One that dropped
a sentinel into the env var, and another with a struct member on
TestCase. This consolidates the two, using the cleaner struct member
internal mechanism and the nicer `resource.UnitTest()` entry point.
This commit is contained in:
Paul Hinze 2016-07-01 13:08:43 -05:00
parent fff30cc897
commit 8c741db144

View File

@ -9,10 +9,9 @@ import (
) )
func TestState_basic(t *testing.T) { func TestState_basic(t *testing.T) {
resource.Test(t, resource.TestCase{ resource.UnitTest(t, resource.TestCase{
OverrideEnvVar: true, PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders,
Providers: testAccProviders,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
{ {
Config: testAccState_basic, Config: testAccState_basic,
@ -26,10 +25,9 @@ func TestState_basic(t *testing.T) {
} }
func TestState_complexOutputs(t *testing.T) { func TestState_complexOutputs(t *testing.T) {
resource.Test(t, resource.TestCase{ resource.UnitTest(t, resource.TestCase{
OverrideEnvVar: true, PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders,
Providers: testAccProviders,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
{ {
Config: testAccState_complexOutputs, Config: testAccState_complexOutputs,