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

Display file and line number in deprecation warning #313

Merged

Conversation

floehopper
Copy link
Member

This changes the output from:


*** Mocha deprecation warning at test.rb:7:in `test_foo': Passing a block is deprecated.


To:

Mocha deprecation warning at test.rb:7:in `test_foo': Passing a block is deprecated.
  • Includes file and line number where deprecated method was called
  • Makes deprecation warnings less prominent - fewer surrounding newlines & no leading asterisks
  • Remove debug mode from Mocha::Deprecation - now only :enabled or :disabled are valid

Fixes #312.

@floehopper
Copy link
Member Author

Rebasing againstmaster and force-pushing in preparation for merging.

The newlines before and after each deprecation warning and
the multiple leading asterisks make the warnings are a bit
over the top, especially when lots of them occur within a
test suite.
Fixes #312.

I've also removed the code which displayed the backtrace for
deprecation warnings in debug mode, because this is now
redundant.
@floehopper floehopper force-pushed the display-file-and-line-number-in-deprecation-warning branch from 7d13697 to 6e40487 Compare January 6, 2018 12:47
@floehopper
Copy link
Member Author

The Travis CI build has now passed and so I'm happy to merge this.

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.

None yet

1 participant