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

Warn if integration using mocha/{test_unit,minitest} fails #389

Conversation

nitishr
Copy link
Contributor

@nitishr nitishr commented Oct 16, 2019

As suggested in #229

@floehopper
Copy link
Member

Unfortunately #229 didn't really explain the issue thoroughly enough. I've updated the description of that issue to explain why we're not yet ready to apply the changes in this PR.

@floehopper
Copy link
Member

Also I was imagining using Ruby's Kernel#warn directly since I don't think that strictly speaking this is a deprecation as such.

@nitishr
Copy link
Contributor Author

nitishr commented Oct 19, 2019

Would it help if I changed the message from:

Deprecation.warning("MiniTest must be loaded *before* require 'mocha/minitest'.")

to

warn("MiniTest must be loaded *before* loading mocha.")

for minitest and a similar change for test-unit, i.e. not including the specific require statement (require mocha/minitest or require mocha/test_unit) in the warning message explicitly?

I think it'll be less/not confusing then, and will be more helpful than silence for someone whose test library integration has failed.

Even otherwise, I think it's more helpful to warn someone for whom the integration has failed than to avoid what a tiny (IMO) bit of confusion for someone who tried to integrate using the legacy/undocument require mocha/setup option.

@floehopper
Copy link
Member

I'm away at the moment, but I'll look at this as soon as I get time. Sorry for the delay.

@floehopper
Copy link
Member

I've belatedly realised that I was confused in my previous comments on this PR. I had confused mocha/test_unit.rb and mocha/minitest.rb with mocha/integration/test_unit.rb and mocha/integration/mini_test.rb. The former are not loaded/called by mocha/setup.rb whereas the latter are. I've updated #229 to reflect this (i.e. pretty much reverted it back to how it was). I've also created a new issue (#398) as a reminder to deprecate the use of "mocha/setup" which I now understand is a separate issue.

I also agree that it's sensible to use deprecation warnings in this PR as a first step; then as a later step we can fail fast. I don't know what I was thinking when I suggested using Kernel#warn.

Sorry for all the confusion. I will get this merged shortly.

@floehopper
Copy link
Member

Tweaked very slightly and merged in c6032d0. Closing.

@floehopper floehopper closed this Nov 3, 2019
floehopper added a commit that referenced this pull request Nov 3, 2019
These were not namespaced and it turns out they aren't actually tested
in the build.
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.

2 participants