@@ -5,10 +5,10 @@ import (
55 . "github.com/onsi/gomega"
66)
77
8- var _ = Describe ("GitOpsConfig getValueWithDefault" , func () {
8+ var _ = Describe ("PatternsOperatorConfig getValueWithDefault" , func () {
99 Context ("when the key exists in the config" , func () {
1010 It ("should return the config value" , func () {
11- config := GitOpsConfig {
11+ config := PatternsOperatorConfig {
1212 "gitops.channel" : "custom-channel" ,
1313 }
1414 Expect (config .getValueWithDefault ("gitops.channel" )).To (Equal ("custom-channel" ))
@@ -17,56 +17,56 @@ var _ = Describe("GitOpsConfig getValueWithDefault", func() {
1717
1818 Context ("when the key does not exist in config but exists in defaults" , func () {
1919 It ("should return the default value for gitops.channel" , func () {
20- config := GitOpsConfig {}
20+ config := PatternsOperatorConfig {}
2121 Expect (config .getValueWithDefault ("gitops.channel" )).To (Equal (GitOpsDefaultChannel ))
2222 })
2323
2424 It ("should return the default value for gitops.catalogSource" , func () {
25- config := GitOpsConfig {}
25+ config := PatternsOperatorConfig {}
2626 Expect (config .getValueWithDefault ("gitops.catalogSource" )).To (Equal (GitOpsDefaultCatalogSource ))
2727 })
2828
2929 It ("should return the default value for gitops.sourceNamespace" , func () {
30- config := GitOpsConfig {}
30+ config := PatternsOperatorConfig {}
3131 Expect (config .getValueWithDefault ("gitops.sourceNamespace" )).To (Equal (GitOpsDefaultCatalogSourceNamespace ))
3232 })
3333
3434 It ("should return the default value for gitops.installApprovalPlan" , func () {
35- config := GitOpsConfig {}
35+ config := PatternsOperatorConfig {}
3636 Expect (config .getValueWithDefault ("gitops.installApprovalPlan" )).To (Equal (GitOpsDefaultApprovalPlan ))
3737 })
3838
3939 It ("should return the default value for gitea.chartName" , func () {
40- config := GitOpsConfig {}
40+ config := PatternsOperatorConfig {}
4141 Expect (config .getValueWithDefault ("gitea.chartName" )).To (Equal (GiteaChartName ))
4242 })
4343
4444 It ("should return the default value for gitea.helmRepoUrl" , func () {
45- config := GitOpsConfig {}
45+ config := PatternsOperatorConfig {}
4646 Expect (config .getValueWithDefault ("gitea.helmRepoUrl" )).To (Equal (GiteaHelmRepoUrl ))
4747 })
4848
4949 It ("should return the default value for gitea.chartVersion" , func () {
50- config := GitOpsConfig {}
50+ config := PatternsOperatorConfig {}
5151 Expect (config .getValueWithDefault ("gitea.chartVersion" )).To (Equal (GiteaDefaultChartVersion ))
5252 })
5353
5454 It ("should return the default value for analytics.enabled" , func () {
55- config := GitOpsConfig {}
55+ config := PatternsOperatorConfig {}
5656 Expect (config .getValueWithDefault ("analytics.enabled" )).To (Equal ("true" ))
5757 })
5858 })
5959
6060 Context ("when the key does not exist in config or defaults" , func () {
6161 It ("should return an empty string" , func () {
62- config := GitOpsConfig {}
62+ config := PatternsOperatorConfig {}
6363 Expect (config .getValueWithDefault ("nonexistent.key" )).To (Equal ("" ))
6464 })
6565 })
6666
6767 Context ("when config overrides a default value" , func () {
6868 It ("should return the overridden value, not the default" , func () {
69- config := GitOpsConfig {
69+ config := PatternsOperatorConfig {
7070 "gitops.channel" : "gitops-1.99" ,
7171 }
7272 Expect (config .getValueWithDefault ("gitops.channel" )).To (Equal ("gitops-1.99" ))
@@ -75,13 +75,13 @@ var _ = Describe("GitOpsConfig getValueWithDefault", func() {
7575
7676 Context ("when config is nil" , func () {
7777 It ("should return the default value" , func () {
78- var config GitOpsConfig
78+ var config PatternsOperatorConfig
7979 Expect (config .getValueWithDefault ("gitops.channel" )).To (Equal (GitOpsDefaultChannel ))
8080 })
8181 })
8282})
8383
84- var _ = Describe ("DefaultPatternOperatorConfig " , func () {
84+ var _ = Describe ("DefaultPatternsOperatorConfig " , func () {
8585 It ("should contain all expected keys" , func () {
8686 expectedKeys := []string {
8787 "gitops.catalogSource" ,
@@ -94,14 +94,14 @@ var _ = Describe("DefaultPatternOperatorConfig", func() {
9494 "analytics.enabled" ,
9595 }
9696 for _ , key := range expectedKeys {
97- Expect (DefaultPatternOperatorConfig ).To (HaveKey (key ))
97+ Expect (DefaultPatternsOperatorConfig ).To (HaveKey (key ))
9898 }
9999 })
100100
101101 It ("should have correct default values" , func () {
102- Expect (DefaultPatternOperatorConfig ["gitops.catalogSource" ]).To (Equal ("redhat-operators" ))
103- Expect (DefaultPatternOperatorConfig ["gitops.sourceNamespace" ]).To (Equal ("openshift-marketplace" ))
104- Expect (DefaultPatternOperatorConfig ["gitops.installApprovalPlan" ]).To (Equal ("Automatic" ))
105- Expect (DefaultPatternOperatorConfig ["analytics.enabled" ]).To (Equal ("true" ))
102+ Expect (DefaultPatternsOperatorConfig ["gitops.catalogSource" ]).To (Equal ("redhat-operators" ))
103+ Expect (DefaultPatternsOperatorConfig ["gitops.sourceNamespace" ]).To (Equal ("openshift-marketplace" ))
104+ Expect (DefaultPatternsOperatorConfig ["gitops.installApprovalPlan" ]).To (Equal ("Automatic" ))
105+ Expect (DefaultPatternsOperatorConfig ["analytics.enabled" ]).To (Equal ("true" ))
106106 })
107107})
0 commit comments