Index: impl/memory/info_test.go |
diff --git a/impl/memory/info_test.go b/impl/memory/info_test.go |
index 6c7fbac611825bb30f14f23e1a7a23aa007a58e1..200f43764962e5d6d044fb5658c346ba61d3bdd5 100644 |
--- a/impl/memory/info_test.go |
+++ b/impl/memory/info_test.go |
@@ -25,4 +25,23 @@ func TestMustNamespace(t *testing.T) { |
i.MustNamespace("invalid namespace name") |
}, ShouldPanic) |
}) |
+ |
+ Convey("Testable interface works", t, func() { |
+ c := Use(context.Background()) |
+ c = useGID(c, func(mod *globalInfoData) { |
+ mod.appid = "app-id" |
+ }) |
+ |
+ // Default value. |
+ So(info.Get(c).AppID(), ShouldEqual, "app-id") |
+ So(info.Get(c).RequestID(), ShouldEqual, "test-request-id") |
+ |
+ // Setting to "override" applies to initial context. |
+ c = info.Get(c).Testable().SetRequestID("override") |
+ So(info.Get(c).RequestID(), ShouldEqual, "override") |
+ |
+ // Derive inner context, "override" applies. |
+ c = info.Get(c).MustNamespace("valid_namespace_name") |
+ So(info.Get(c).RequestID(), ShouldEqual, "override") |
+ }) |
} |