From 8c741db1445867f86118cc784d3d316631f340ab Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Fri, 1 Jul 2016 13:08:43 -0500 Subject: [PATCH] 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. --- data_source_state_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/data_source_state_test.go b/data_source_state_test.go index bfe81fa77..26db76db6 100644 --- a/data_source_state_test.go +++ b/data_source_state_test.go @@ -9,10 +9,9 @@ import ( ) func TestState_basic(t *testing.T) { - resource.Test(t, resource.TestCase{ - OverrideEnvVar: true, - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + resource.UnitTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccState_basic, @@ -26,10 +25,9 @@ func TestState_basic(t *testing.T) { } func TestState_complexOutputs(t *testing.T) { - resource.Test(t, resource.TestCase{ - OverrideEnvVar: true, - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + resource.UnitTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccState_complexOutputs,