Skip to content

Commit

Permalink
Remove OpenStruct from the project (solve warnings) (#1169)
Browse files Browse the repository at this point in the history
* Chore: replace references to `OpenStruct` with RSpec doubles

* Chore: remove `OpenStruct` exception from `.rubocop.yml`
  • Loading branch information
arthurhess authored Nov 7, 2024
1 parent c4edf7e commit 11f60a3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ Performance/InefficientHashSearch:

Performance/OpenStruct:
Enabled: true
Exclude:
- spec/**/*

Performance/RangeInclude:
Enabled: true
Expand Down
1 change: 0 additions & 1 deletion spec/delayed/backend/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'ostruct'
require 'delayed_job'
require 'delayed/backend/base'

Expand Down
5 changes: 2 additions & 3 deletions spec/rollbar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require 'active_support/json/encoding'

require 'rollbar/item'
require 'ostruct'

require 'spec_helper'

Expand Down Expand Up @@ -242,7 +241,7 @@
notifier.configuration = configuration
allow_any_instance_of(Net::HTTP)
.to receive(:request)
.and_return(OpenStruct.new(:code => 500, :body => 'Error'))
.and_return(double(code: 500, body: 'Error'))
@uri = URI.parse(Rollbar::Configuration::DEFAULT_ENDPOINT)
end

Expand Down Expand Up @@ -1518,7 +1517,7 @@ def backtrace
before do
allow_any_instance_of(Net::HTTP)
.to receive(:request)
.and_return(OpenStruct.new(:code => 200, :body => 'Success'))
.and_return(double(code: 200, body: 'Success'))
@env_vars = clear_proxy_env_vars
end

Expand Down

0 comments on commit 11f60a3

Please sign in to comment.