File: 0001-Set-year-to-fixed-value-in-golden-tests.patch

package info (click to toggle)
cobra-cli 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 460 kB
  • sloc: makefile: 46
file content (33 lines) | stat: -rw-r--r-- 942 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Description: Set year to fixed value in golden tests
 Shengjing's original patch was dated Sun, 10 Jan 2021 04:25:26 +0800.
Author: Shengjing Zhu <zhsj@debian.org>
Origin: vendor
Forwarded: not-needed
Reviewed-by: Anthony Fok <foka@debian.org>
Last-Update: 2021-12-30, 2022-04-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/cmd/add_test.go
+++ b/cmd/add_test.go
@@ -11,6 +11,9 @@
 func TestGoldenAddCmd(t *testing.T) {
 	viper.Set("useViper", true)
 	viper.Set("license", "apache")
+	viper.Set("year", "2022")
+	defer viper.Set("year", nil)
+
 	command := &Command{
 		CmdName:   "test",
 		CmdParent: parentName,
--- a/cmd/init_test.go
+++ b/cmd/init_test.go
@@ -49,6 +49,9 @@
 
 			viper.Set("useViper", true)
 			viper.Set("license", "apache")
+			viper.Set("year", "2022")
+			defer viper.Set("year", nil)
+
 			projectPath, err := initializeProject(tt.args)
 			defer func() {
 				if projectPath != "" {