-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aziz Ishan-Khojaev
committed
Mar 13, 2024
1 parent
fbe89a5
commit 156a782
Showing
2 changed files
with
30 additions
and
1 deletion.
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,29 @@ | ||
package cmd | ||
|
||
// import ( | ||
// "testing" | ||
|
||
// "github.com/metal-stack/metalctl/cmd/completion" | ||
// "github.com/spf13/afero" | ||
// ) | ||
|
||
// func TestUpdateDoCommand(t *testing.T) { | ||
// c := &config{fs: afero.NewMemMapFs(), out: nil, driverURL: "", comp: &completion.Completion{}, client: nil, log: nil, describePrinter: nil, listPrinter: nil} // Initialize your config here as needed | ||
// test := newRootCmd(c) | ||
// //updateCmd := newUpdateCmd(c) | ||
|
||
// // Simulate "update do --version v0.15.3" | ||
// test.SetArgs([]string{"update", "do", "--version", "v0.15.3"}) | ||
|
||
// // Execute the command | ||
// err := test.Execute() | ||
// if err != nil { | ||
// t.Fatalf("updateCmd.Execute() failed: %v", err) | ||
// } | ||
|
||
// // Assert that desired version is set to "v0.15.3" | ||
// // This step assumes you have a way to verify the version was set correctly, | ||
// // such as checking a variable in your application that should be set based on the flag. | ||
// // Since your current implementation directly uses Viper and updater.New(), | ||
// // you might need to refactor to make it testable or mock certain parts. | ||
// } |