Commit dfaa8a39 authored by mehulsharma's avatar mehulsharma

Fix OpenStruct use

Fixed OpenStruct use since Ruby 3 discourages it

Changelog: other
parent cdff7b0a
...@@ -2594,7 +2594,6 @@ Style/OpenStructUse: ...@@ -2594,7 +2594,6 @@ Style/OpenStructUse:
- 'spec/lib/gitlab/database/migrations/runner_spec.rb' - 'spec/lib/gitlab/database/migrations/runner_spec.rb'
- 'spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb' - 'spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb'
- 'spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb' - 'spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb'
- 'spec/lib/gitlab/grape_logging/loggers/exception_logger_spec.rb'
- 'spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb' - 'spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb'
- 'spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb' - 'spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb'
- 'spec/lib/gitlab/legacy_github_import/project_creator_spec.rb' - 'spec/lib/gitlab/legacy_github_import/project_creator_spec.rb'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Gitlab::GrapeLogging::Loggers::ExceptionLogger do RSpec.describe Gitlab::GrapeLogging::Loggers::ExceptionLogger do
let(:mock_request) { OpenStruct.new(env: {}) } let(:mock_request) { double('env', env: {}) }
let(:response_body) { nil } let(:response_body) { nil }
describe ".parameters" do describe ".parameters" do
...@@ -76,7 +76,7 @@ RSpec.describe Gitlab::GrapeLogging::Loggers::ExceptionLogger do ...@@ -76,7 +76,7 @@ RSpec.describe Gitlab::GrapeLogging::Loggers::ExceptionLogger do
describe 'when an exception is available' do describe 'when an exception is available' do
let(:exception) { RuntimeError.new('This is a test') } let(:exception) { RuntimeError.new('This is a test') }
let(:mock_request) do let(:mock_request) do
OpenStruct.new( double('env',
env: { env: {
::API::Helpers::API_EXCEPTION_ENV => exception ::API::Helpers::API_EXCEPTION_ENV => exception
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment