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

[WIP] Fail fast if mocking before setup #319

Closed
wants to merge 3 commits into from

Conversation

floehopper
Copy link
Member

This is work that came out of #292.

It needs more work before it can be merged, but I thought it was worth making it into a PR to highlight the work that has already been done.

i.e. outside the per-test lifecycle; e.g. RSpec's `before(:all)` blocks.

In this commit a "Null Object" Mockery instance is set as the default
and only replaced by the a real Mockery instance when
`Hooks#mocha_setup` is called by the test framework, i.e. once the
lifecycle of an individual test has started.

The Mockery is now always explicitly built, rather than being
lazily instantiated.

Using a `StubbingError` filters the Mocha files out of the backtrace.

I have not modified the existing tests nor added any new ones, so this
will need some work before it can be merged into `master`.

See #292 for more details.
@floehopper floehopper force-pushed the spike-fail-fast-if-mocking-before-setup branch from b3106d6 to 1da71b9 Compare March 27, 2018 18:28
@floehopper
Copy link
Member Author

Superseded by #327. Closing.

@floehopper floehopper closed this Mar 30, 2018
@lzap
Copy link

lzap commented Apr 3, 2018

This branch did not work for me, lemme try the new one.

@floehopper floehopper deleted the spike-fail-fast-if-mocking-before-setup branch June 16, 2019 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants