From fd62731c0d2909d5f2e31192f98dedcd743e449a Mon Sep 17 00:00:00 2001 From: Damyan Yordanov Date: Wed, 18 Sep 2024 10:20:15 +0200 Subject: [PATCH] Test setup functions --- plugins/metal/plugin_test.go | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/plugins/metal/plugin_test.go b/plugins/metal/plugin_test.go index ed20c18..18f9a7b 100644 --- a/plugins/metal/plugin_test.go +++ b/plugins/metal/plugin_test.go @@ -84,18 +84,33 @@ var _ = Describe("Endpoint", func() { }) /* parametrization */ - It("Should return error if less arguments are provided", func() { - err := loadConfig() + It("Setup6 should return error if less arguments are provided", func() { + _, err := setup6() Expect(err).NotTo(BeNil()) }) - It("Should return error if more arguments are provided", func() { - err := loadConfig("foo", "bar") + It("Setup6 should return error if more arguments are provided", func() { + _, err := setup6("foo", "bar") Expect(err).NotTo(BeNil()) }) - It("Should return error if config file does not exist", func() { - err := loadConfig("does-not-exist.json") + It("Setup6 should return error if config file does not exist", func() { + _, err := setup6("does-not-exist.json") + Expect(err).NotTo(BeNil()) + }) + + It("Setup4 should return error if less arguments are provided", func() { + _, err := setup4() + Expect(err).NotTo(BeNil()) + }) + + It("Setup4 should return error if more arguments are provided", func() { + _, err := setup4("foo", "bar") + Expect(err).NotTo(BeNil()) + }) + + It("Setup4 should return error if config file does not exist", func() { + _, err := setup4("does-not-exist.json") Expect(err).NotTo(BeNil()) })