Add tests for scoped registration.