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

Preserve spec instrumentation when stubbing #46

Open
glenjamin opened this issue Mar 22, 2019 · 0 comments
Open

Preserve spec instrumentation when stubbing #46

glenjamin opened this issue Mar 22, 2019 · 0 comments

Comments

@glenjamin
Copy link
Contributor

Spec instrumentation as implemented by spec itself and orchestra both work by altering the var root to wrap the original function with extra behaviour that checks the spec registry and raises errors.

Because bond also replaces the var when doing stubbing, this instrumentation gets lost.

I think it would be useful if spec instrumentation was maintained during stubbing, to ensure that any stubbed behaviour adheres to the spec of the real implementation.

One suggestion from @ericfode was that rather than teach bond about spec instrumentation, we could teach the instrumentation about bond. Bond itself would then need some fairly generic code to pick up metadata and apply additional transformations after stubbing.

What do people think?

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

No branches or pull requests

1 participant