-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let weavertest test component implementations.
Before this PR, you could use a weavertest.Runner to test a set of component interfaces: ```go runniner.Test(t, func(t *testing.T, a A, b B, c C) { ... }) ``` This PR extends the API to allow for testing of component implementations. Assuming `a`, `b`, and `c` are the implementing structs of component interfaces `A`, `B`, and `C`, we can now write: ```go runniner.Test(t, func(t *testing.T, a *a, b *b, c *c) { ... }) ``` You can also combine interfaces and implementations: ```go runniner.Test(t, func(t *testing.T, a *a, b B, c1 *c, c2 *c, cIntf C) { ... }) ``` You can also combine this with fakes. All possible combinations of interfaces, implementation pointers, and fakes are allowed with one exception. A fake and implmentation pointer cannot be provided for the same component. This functionality is useful for clearbox testing of components. It is also useful for testing the main HTTP handling code associated with the main component, as demonstrated in `examples/chat/server_test.go`.
- Loading branch information
1 parent
e0ac135
commit 85730c9
Showing
12 changed files
with
858 additions
and
57 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
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
Oops, something went wrong.