Skip to content

Commit

Permalink
Disable Rubocop rule to prevent test failures
Browse files Browse the repository at this point in the history
Running `rubocop -A` detects and corrects the following "offense":

  spec/shared_context/shared_send_heat_pump.rb:15:29: C: [Corrected] RSpec/VerifiedDoubleReference: Use a constant class reference for verified doubles. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubleReference)
      response = class_double("response")
                              ^^^^^^^^^^

However, the updated code (`response = class_double(response)`) does not work and causes 2 test failures with the error:
]
  ArgumentError: Module or String expected, got nil

So we want to stop rubocop from updating htis line of code, which can be done by adding this comment to the line.
  • Loading branch information
TheDoubleK committed Aug 6, 2024
1 parent 1a539f9 commit 70d6c04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/shared_context/shared_send_heat_pump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def template_id
end

def stub_notify_response
response = class_double("response")
response = class_double("response") # rubocop:disable RSpec/VerifiedDoubleReference
allow(response).to receive_messages(code: 400, body: notify_body.to_s)
response
end
Expand Down

0 comments on commit 70d6c04

Please sign in to comment.