-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
Suggested cop: Prefer built-in time helpers to Timecop #20
Comments
|
But not everybody uses RSpec and, afaik, rails new defaults to minitest. |
Fair enough! Actually, a cop targeting minitest would be be a better fit, as TimeHelpers are (to my best understanding) always included, and this means that it tears down automatically. Which is, unfortunately, not so simple with RSpec. |
What do you mean by this? ContextEnforcing For RSpec specs using So yes, not having to think about RSpec dramatically simplifies things, but given that Minitest is the default (via The simplest thing would probably be for the cop to be disabled by default if the project is using RSpec, but expose a config to override that if the project maintainer chooses to do so (e.g. if they add the Minitest lifecycle hooks compatibility layer to their Alternatively, But unless something has changed, the conclusion in #38 (although I still disagree) was that a Footnotes
|
Most of Timecop's behaviour is now built into Rails.
https://api.rubyonrails.org/v5.1/classes/ActiveSupport/Testing/TimeHelpers.html
Related: rubocop/rspec-style-guide#71
The text was updated successfully, but these errors were encountered: