-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed to use antijoke tests (no BDD)
- Loading branch information
1 parent
19c7ccf
commit 0983778
Showing
13 changed files
with
99 additions
and
147 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Binary file not shown.
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
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
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,39 @@ | ||
package pack | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/privateerproj/privateer-pack-wireframe/internal/config" | ||
"github.com/privateerproj/privateer-sdk/utils" | ||
) | ||
|
||
// KnockKnock is a demo test for dev purposes | ||
func KnockKnock() error { | ||
name, err := getJokeName() | ||
if err != nil { | ||
return err | ||
} | ||
log.Printf("Knock Knock") | ||
log.Printf("Who's There?") | ||
log.Printf(name) | ||
log.Printf("::The listener has lost interest and left::") | ||
return nil | ||
} | ||
|
||
// ChickenCrossedRoad is a demo test for dev purposes | ||
func ChickenCrossedRoad() error { | ||
name, err := getJokeName() | ||
if err != nil { | ||
return err | ||
} | ||
log.Printf("Me: Why did the chicken cross the road?") | ||
log.Printf("%s: I'm busy, leave me alone.", name) | ||
return nil | ||
} | ||
|
||
func getJokeName() (string, error) { | ||
if config.Vars.Raids.Wireframe.JokeName != "" { | ||
return config.Vars.Raids.Wireframe.JokeName, nil | ||
} | ||
return "", utils.ReformatError("JokeName must be set in the config file or env vars (PVTR_WIREFRAME_JOKE_NAME)") | ||
} |
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 |
---|---|---|
@@ -1,19 +1,16 @@ | ||
package pack | ||
|
||
import ( | ||
"github.com/markbates/pkger" | ||
"github.com/privateerproj/privateer-pack-wireframe/internal/welcome" | ||
"github.com/privateerproj/privateer-sdk/probeengine" | ||
"github.com/privateerproj/privateer-sdk/raidengine" | ||
) | ||
|
||
// GetProbes returns a list of probe objects | ||
func GetProbes() []probeengine.Probe { | ||
return []probeengine.Probe{ | ||
welcome.Probe, | ||
} | ||
func GetProbes() []raidengine.Strike { | ||
return Policies["PCI"] | ||
} | ||
|
||
func init() { | ||
// pkger.Include is a no-op that directs the pkger tool to include the desired file or folder. | ||
pkger.Include("/internal/welcome/welcome.feature") | ||
// Policies contains a list of different functions to run for each policy type | ||
var Policies = map[string][]raidengine.Strike{ | ||
"PCI": []raidengine.Strike{KnockKnock}, | ||
"CIS": []raidengine.Strike{KnockKnock, ChickenCrossedRoad}, | ||
} |