From 4c104ca9844c659233501bd567805b53125dd4e8 Mon Sep 17 00:00:00 2001 From: Stella Lok Date: Fri, 14 Aug 2020 16:04:32 +0800 Subject: [PATCH] fix test error on windows --- cmd/orb_test.go | 25 ++++++++++++++----- .../gql_orb_category_list/text_output.txt | 17 ------------- 2 files changed, 19 insertions(+), 23 deletions(-) delete mode 100644 cmd/testdata/gql_orb_category_list/text_output.txt diff --git a/cmd/orb_test.go b/cmd/orb_test.go index e311c0ae5..cb182292e 100644 --- a/cmd/orb_test.go +++ b/cmd/orb_test.go @@ -2651,11 +2651,7 @@ https://circleci.com/orbs/registry/orb/my/orb tmpBytes = golden.Get(GinkgoT(), filepath.FromSlash("gql_orb_category_list/second_response.json")) secondResponse := string(tmpBytes) - expectedOutputPath := "gql_orb_category_list/text_output.txt" - if json { - expectedOutputPath = "gql_orb_category_list/pretty_json_output.json" - } - tmpBytes = golden.Get(GinkgoT(), filepath.FromSlash(expectedOutputPath)) + tmpBytes = golden.Get(GinkgoT(), filepath.FromSlash("gql_orb_category_list/pretty_json_output.json")) expectedOutput := string(tmpBytes) tempSettings.AppendPostHandler("", clitest.MockRequestResponse{ @@ -2680,7 +2676,24 @@ https://circleci.com/orbs/registry/orb/my/orb if json { Expect(displayedOutput).Should(MatchJSON(expectedOutput)) } else { - Expect(displayedOutput).To(Equal(expectedOutput)) + Expect(displayedOutput).To(Equal(`Artifacts/Registry +Build +Cloud Platform +Code Analysis +Collaboration +Containers +Deployment +Infra Automation +Kubernetes +Language/Framework +Monitoring +Notifications +Reporting +Security +Testing +Windows Server 2003 +Windows Server 2010 +`)) } }, Entry("with --json", true), diff --git a/cmd/testdata/gql_orb_category_list/text_output.txt b/cmd/testdata/gql_orb_category_list/text_output.txt deleted file mode 100644 index 5f3f3612d..000000000 --- a/cmd/testdata/gql_orb_category_list/text_output.txt +++ /dev/null @@ -1,17 +0,0 @@ -Artifacts/Registry -Build -Cloud Platform -Code Analysis -Collaboration -Containers -Deployment -Infra Automation -Kubernetes -Language/Framework -Monitoring -Notifications -Reporting -Security -Testing -Windows Server 2003 -Windows Server 2010