summaryrefslogtreecommitdiff
path: root/assets/component-oriented-design/v1
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2020-11-27 17:26:39 -0700
committerBrian Picciano <mediocregopher@gmail.com>2020-11-28 17:54:17 -0700
commitd40fe1021392da2c74bc6156ad2734071c615495 (patch)
treef400aeca701756ec9c738f94bf99db1fe904a590 /assets/component-oriented-design/v1
parente346068f586b6011f3e665a552945e30dce12c25 (diff)
rewrite CoP post to use new examples
Diffstat (limited to 'assets/component-oriented-design/v1')
-rw-r--r--assets/component-oriented-design/v1/main_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/assets/component-oriented-design/v1/main_test.go b/assets/component-oriented-design/v1/main_test.go
index 6976690..6cfd9fb 100644
--- a/assets/component-oriented-design/v1/main_test.go
+++ b/assets/component-oriented-design/v1/main_test.go
@@ -114,7 +114,7 @@ func TestScoreboard(t *testing.T) {
}
////////////////////////////////////////////////////////////////////////////////
-// Test httpHandler component
+// Test httpHandlers component
type mockScoreboard map[string]int
@@ -155,3 +155,13 @@ func TestHTTPHandlers(t *testing.T) {
r = httptest.NewRequest("GET", "/scores", nil)
assertRequest(t, 200, "bar: 2\nfoo: 1\n", r)
}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// httpServer is NOT tested, for the following reasons:
+// * It depends on a `net.Listener`, which is not trivial to mock.
+// * It does very little besides passing an httpHandlers along to an http.Server
+// and managing cleanup.
+// * It isn't likely to be changed often.
+// * If it were to break it would be very apparent in subsequent testing stages.
+//