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 CanInvoke for easy validation #182

Open
robfig opened this issue Mar 3, 2018 · 1 comment
Open

Add CanInvoke for easy validation #182

robfig opened this issue Mar 3, 2018 · 1 comment

Comments

@robfig
Copy link

robfig commented Mar 3, 2018

I would like to be able to write a unit test that validates that the set of dig providers is correct to invoke a particular function. Since some providers are RPC clients and DB clients which are required by other injected types, it's impossible to do this without making it an integration test, which feels unnecessarily brittle.

How do you feel about providing a method that just checks the needed items are provided to Invoke something, returning the error that would have been returned otherwise?

@akshayjshah
Copy link
Contributor

Hi! I'm so sorry for the long delay here - I didn't realize that I wasn't subscribed to this repo. (And thanks for writing Revel!)

I'm definitely open to this. If you don't have the bandwidth to open a PR, I'll keep it in our backlog.

If you haven't, take a look at fx (github.com/uber-go/fx) too - it's the service framework that we built around this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants