-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: circleci orb list --uncertified --details no longer crashes (#851)
- Loading branch information
1 parent
0a0bcbd
commit c6dc6bf
Showing
2 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package cmd | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/CircleCI-Public/circleci-cli/api" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/ginkgo/extensions/table" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Orb unit tests", func() { | ||
Describe("Orb formatters", func() { | ||
DescribeTable( | ||
"parameterDefaultToString", | ||
func(input api.OrbElementParameter, expected string) { | ||
Expect(parameterDefaultToString(input)).To(Equal(expected)) | ||
}, | ||
Entry( | ||
"Normal behaviour for string", | ||
api.OrbElementParameter{ | ||
Type: "string", | ||
Description: "", | ||
Default: "Normal behavior", | ||
}, | ||
" (default: 'Normal behavior')", | ||
), | ||
Entry( | ||
"Normal behaviour for enum", | ||
api.OrbElementParameter{ | ||
Type: "enum", | ||
Description: "", | ||
Default: "Normal behavior", | ||
}, | ||
" (default: 'Normal behavior')", | ||
), | ||
Entry( | ||
"Normal behaviour for boolean", | ||
api.OrbElementParameter{ | ||
Type: "boolean", | ||
Description: "", | ||
Default: true, | ||
}, | ||
" (default: 'true')", | ||
), | ||
Entry( | ||
"String value for boolean", | ||
api.OrbElementParameter{ | ||
Type: "boolean", | ||
Description: "", | ||
Default: "yes", | ||
}, | ||
" (default: 'yes')", | ||
), | ||
Entry( | ||
"Time value for string", | ||
api.OrbElementParameter{ | ||
Type: "string", | ||
Description: "", | ||
Default: time.Date(2023, 02, 20, 11, 9, 0, 0, time.Now().UTC().Location()), | ||
}, | ||
" (default: '2023-02-20 11:09:00 +0000 UTC')", | ||
), | ||
) | ||
}) | ||
}) |