Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic tests #5

Closed
wants to merge 1 commit into from
Closed

Add basic tests #5

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 16, 2016

Fixes /issues/4.

License: MIT
Signed-off-by: Vasily Kolobkov <polezaivsani@openmailbox.org>

func TestPutCallsGetMeasured(t *testing.T) {
metrics.InjectImpl(newMockCreator)
defer metrics.InjectImpl(nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work as it won't allow you inject new implementation when one is already injected.

I might have to think how to resolve it.

Allowing unregistering the injected creator might not be a bad idea.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i see now. I can call the InjectImpl once upon setup in TestMain ruling it out for the tests. Unregistering would be another option, though i'm unfamiliar with that part of town.

@Stebalien Stebalien closed this May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants