-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement injection for events (fixes #56)
- Loading branch information
1 parent
c6f1ae1
commit 6571dec
Showing
4 changed files
with
77 additions
and
32 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
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,23 @@ | ||
module Logger | ||
|
||
open TickSpec | ||
open System | ||
|
||
type LogMessages = string list | ||
|
||
type LoggerContext = { Messages: LogMessages } | ||
|
||
let [<BeforeScenario>] setup () = | ||
{ Messages = "Before scenario" |> List.singleton } | ||
|
||
let [<BeforeStep>] beforeStep (previousMessages: LoggerContext) = | ||
{ Messages = "Before step" :: previousMessages.Messages } | ||
|
||
let [<AfterStep>] afterStep (previousMessages: LoggerContext) = | ||
{ Messages = "After step" :: previousMessages.Messages } | ||
|
||
let [<AfterScenario>] afterScenario (previousMessages: LoggerContext) = | ||
let allMessages = | ||
"After scenario" :: previousMessages.Messages | ||
|> List.rev | ||
allMessages |> List.iter Console.WriteLine |
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