This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: reboot and replace machine, destroy orb
- Loading branch information
1 parent
c6ab27a
commit 40875cf
Showing
3 changed files
with
147 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package orbctl_test | ||
|
||
import ( | ||
"github.com/onsi/gomega/gexec" | ||
"github.com/onsi/gomega/types" | ||
) | ||
|
||
type flakyExitMatcher struct { | ||
types.GomegaMatcher | ||
} | ||
|
||
// FlakyExit is a custom matcher that wraps the gomega matcher returned by gexec.Exit | ||
// and overwrites its MatchMayChangeInTheFuture to always return true. This ensures | ||
// that an assertion with Eventually considers that a terminated command could change | ||
// its return code if it's executed again. | ||
func FlakyExit(code ...int) types.GomegaMatcher { | ||
return &flakyExitMatcher{ | ||
gexec.Exit(code...), | ||
} | ||
} | ||
|
||
func (f *flakyExitMatcher) MatchMayChangeInTheFuture(_ interface{}) bool { | ||
return true | ||
} |
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