From 823f4a1d6d6fba7ab32877f451e7b660af03df9f Mon Sep 17 00:00:00 2001 From: David Alpert Date: Sun, 19 Nov 2023 11:27:01 -0600 Subject: [PATCH] test: reproduce issue #1 default output format is sometimes nil --- v1/v1_tests.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 v1/v1_tests.go diff --git a/v1/v1_tests.go b/v1/v1_tests.go new file mode 100644 index 0000000..a5fb1f8 --- /dev/null +++ b/v1/v1_tests.go @@ -0,0 +1,25 @@ +package printers + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("go-printers", func() { + Describe("#NewPrinterOptions", func() { + var o *PrinterOptions + + BeforeEach(func() { + o = NewPrinterOptions() + }) + + It("should set default output to text", func() { + Ω(o.DefaultOutputFormat).ShouldNot(BeNil()) + Ω(*o.DefaultOutputFormat).Should(Equal("text")) + }) + + It("should set output to nil", func() { + Ω(o.OutputFormat).Should(BeNil()) + }) + }) +})