Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
eebf72d8
Commit
eebf72d8
authored
Dec 02, 2021
by
Siddharth Asthana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the offences introduced by Performance/OpenStruct
Changelog: other
parent
3dbb300d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
.rubocop_todo/style/open_struct_use.yml
.rubocop_todo/style/open_struct_use.yml
+0
-1
lib/mattermost/session.rb
lib/mattermost/session.rb
+6
-1
spec/lib/mattermost/session_spec.rb
spec/lib/mattermost/session_spec.rb
+6
-0
No files found.
.rubocop_todo/style/open_struct_use.yml
View file @
eebf72d8
...
@@ -11,7 +11,6 @@ Style/OpenStructUse:
...
@@ -11,7 +11,6 @@ Style/OpenStructUse:
-
lib/gitlab/git/diff_collection.rb
-
lib/gitlab/git/diff_collection.rb
-
lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb
-
lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb
-
lib/gitlab/testing/request_inspector_middleware.rb
-
lib/gitlab/testing/request_inspector_middleware.rb
-
lib/mattermost/session.rb
-
spec/factories/go_module_versions.rb
-
spec/factories/go_module_versions.rb
-
spec/factories/wiki_pages.rb
-
spec/factories/wiki_pages.rb
-
spec/graphql/mutations/branches/create_spec.rb
-
spec/graphql/mutations/branches/create_spec.rb
...
...
lib/mattermost/session.rb
View file @
eebf72d8
...
@@ -27,6 +27,11 @@ module Mattermost
...
@@ -27,6 +27,11 @@ module Mattermost
LEASE_TIMEOUT
=
60
LEASE_TIMEOUT
=
60
Request
=
Struct
.
new
(
:parameters
,
keyword_init:
true
)
do
def
method_missing
(
method_name
,
*
args
,
&
block
)
end
end
attr_accessor
:current_resource_owner
,
:token
,
:base_uri
attr_accessor
:current_resource_owner
,
:token
,
:base_uri
def
initialize
(
current_user
)
def
initialize
(
current_user
)
...
@@ -64,7 +69,7 @@ module Mattermost
...
@@ -64,7 +69,7 @@ module Mattermost
end
end
def
request
def
request
@request
||=
OpenStruc
t
.
new
(
parameters:
params
)
@request
||=
Reques
t
.
new
(
parameters:
params
)
end
end
def
params
def
params
...
...
spec/lib/mattermost/session_spec.rb
View file @
eebf72d8
...
@@ -35,6 +35,12 @@ RSpec.describe Mattermost::Session, type: :request do
...
@@ -35,6 +35,12 @@ RSpec.describe Mattermost::Session, type: :request do
it
'makes a request to the oauth uri'
do
it
'makes a request to the oauth uri'
do
expect
{
subject
.
with_session
}.
to
raise_error
(
::
Mattermost
::
NoSessionError
)
expect
{
subject
.
with_session
}.
to
raise_error
(
::
Mattermost
::
NoSessionError
)
end
end
it
'returns nill on calling a non exisitng method on request'
do
return_value
=
subject
.
request
.
method_missing
(
"non_existing_method"
,
"something"
)
do
end
expect
(
return_value
).
to
be
(
nil
)
end
end
end
context
'with oauth_uri'
do
context
'with oauth_uri'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment