From b96b54757b9ee9766533878ed197bd3d83afe7a1 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 10 Mar 2021 16:06:12 -0800 Subject: [PATCH] add unit test --- go.mod | 2 +- workspace_test.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5b196ce42..d33132961 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/hashicorp/go-tfe require ( - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 github.com/google/go-querystring v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.0 github.com/hashicorp/go-retryablehttp v0.5.2 diff --git a/workspace_test.go b/workspace_test.go index a79262a6b..7205d3929 100644 --- a/workspace_test.go +++ b/workspace_test.go @@ -256,6 +256,22 @@ func TestWorkspacesRead(t *testing.T) { }) } +func TestWorkspacesReadWithHistory(t *testing.T) { + client := testClient(t) + + orgTest, orgTestCleanup := createOrganization(t, client) + defer orgTestCleanup() + + wTest, wTestCleanup := createWorkspace(t, client, orgTest) + defer wTestCleanup() + + run, rCleanup := createAppliedRun(t, client, wTest) + defer rCleanup() + + assert.Equal(t, 1, run.Workspace.RunsCount) + assert.Equal(t, 1, run.Workspace.ResourceCount) +} + func TestWorkspacesReadByID(t *testing.T) { client := testClient(t) ctx := context.Background()