generated from snivilised/astrolib
-
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.
- Loading branch information
1 parent
1e124d2
commit 4a9967e
Showing
6 changed files
with
55 additions
and
79 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
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,47 @@ | ||
package cycle_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" //nolint:revive // ok | ||
. "github.com/onsi/gomega" //nolint:revive // ok | ||
|
||
"github.com/snivilised/traverse/core" | ||
"github.com/snivilised/traverse/cycle" | ||
) | ||
|
||
var _ = Describe("controls", func() { | ||
When("bind", func() { | ||
It("should: dispatch notification to event handler", func() { | ||
const path = "/traversal-root" | ||
|
||
var ( | ||
controls cycle.Controls | ||
events cycle.Events | ||
begun bool | ||
ended bool | ||
) | ||
|
||
// init(registry->options): | ||
// | ||
events.Bind(&controls) | ||
|
||
// client: | ||
// | ||
events.Begin.On(func(root string) { | ||
begun = true | ||
Expect(root).To(Equal(path)) | ||
}) | ||
|
||
events.End.On(func(_ core.TraverseResult) { | ||
ended = true | ||
}) | ||
|
||
// component side: | ||
// | ||
controls.Begin.Dispatch.Invoke(path) | ||
controls.End.Dispatch.Invoke(nil) | ||
|
||
Expect(begun).To(BeTrue(), "begin notification handler not invoked") | ||
Expect(ended).To(BeTrue(), "end notification handler not invoked") | ||
}) | ||
}) | ||
}) |
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