We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
travel_to
I have local rspec definition, which named the same as FreezeTime subject method named: travel_to. I use it with Timecop gem.
let(:travel_to) { 47.hours.ago } around { |example| Timecop.travel(travel_to) { example.run } }
I expect this won't violate FreezeTime cop
I'm getting
An error occurred while Rails/FreezeTime cop was inspecting /path/to/test. undefined method `children' for nil:NilClass child_node, method_name, time_argument = *node.first_argument.children ^^^^^^^^^ /Users/mikdiet/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-rails-2.16.1/lib/rubocop/cop/rails/freeze_time.rb:46:in `on_send'
Just run rubocop on the code snippet provided.
If I change name, error is gone.
$ [bundle exec] rubocop -V 1.36.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.1.2) [x86_64-darwin21] - rubocop-performance 1.15.0 - rubocop-rails 2.16.1 - rubocop-rspec 2.13.2 - rubocop-sorbet 0.6.11
The text was updated successfully, but these errors were encountered:
[Fix rubocop#809] Fix an error for Rails/FreezeTime
Rails/FreezeTime
d5f8477
Fixes rubocop#809. This PR fixes an error for `Rails/FreezeTime` when using `travel_to` without argument.
93f4bb7
Merge pull request #810 from koic/fix_error_for_rails_freeze_time
1de4eb3
[Fix #809] Fix an error for `Rails/FreezeTime`
Successfully merging a pull request may close this issue.
Expected behavior
I have local rspec definition, which named the same as FreezeTime subject method named:
travel_to
.I use it with Timecop gem.
I expect this won't violate FreezeTime cop
Actual behavior
I'm getting
Steps to reproduce the problem
Just run rubocop on the code snippet provided.
If I change name, error is gone.
RuboCop version
The text was updated successfully, but these errors were encountered: