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
2bc223c3
Commit
2bc223c3
authored
Oct 08, 2020
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some Ruby 2.7 kwarg warnings in specs
parent
b2ee2fd6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
spec/lib/gitlab/kubernetes/kube_client_spec.rb
spec/lib/gitlab/kubernetes/kube_client_spec.rb
+2
-2
spec/lib/gitlab/sidekiq_cluster_spec.rb
spec/lib/gitlab/sidekiq_cluster_spec.rb
+3
-3
spec/models/concerns/each_batch_spec.rb
spec/models/concerns/each_batch_spec.rb
+3
-3
No files found.
spec/lib/gitlab/kubernetes/kube_client_spec.rb
View file @
2bc223c3
...
...
@@ -9,7 +9,7 @@ RSpec.describe Gitlab::Kubernetes::KubeClient do
let
(
:api_url
)
{
'https://kubernetes.example.com/prefix'
}
let
(
:kubeclient_options
)
{
{
auth_options:
{
bearer_token:
'xyz'
}
}
}
let
(
:client
)
{
described_class
.
new
(
api_url
,
kubeclient_options
)
}
let
(
:client
)
{
described_class
.
new
(
api_url
,
**
kubeclient_options
)
}
before
do
stub_kubeclient_discover
(
api_url
)
...
...
@@ -133,7 +133,7 @@ RSpec.describe Gitlab::Kubernetes::KubeClient do
end
it
'falls back to default options, but allows overriding'
do
client
=
Gitlab
::
Kubernetes
::
KubeClient
.
new
(
api_url
,
{}
)
client
=
described_class
.
new
(
api_url
)
defaults
=
Gitlab
::
Kubernetes
::
KubeClient
::
DEFAULT_KUBECLIENT_OPTIONS
expect
(
client
.
kubeclient_options
[
:timeouts
]).
to
eq
(
defaults
[
:timeouts
])
...
...
spec/lib/gitlab/sidekiq_cluster_spec.rb
View file @
2bc223c3
...
...
@@ -99,7 +99,7 @@ RSpec.describe Gitlab::SidekiqCluster do
allow
(
Process
).
to
receive
(
:spawn
).
and_return
(
1
)
expect
(
described_class
).
to
receive
(
:wait_async
).
with
(
1
)
expect
(
described_class
.
start_sidekiq
(
%w(foo)
,
options
)).
to
eq
(
1
)
expect
(
described_class
.
start_sidekiq
(
%w(foo)
,
**
options
)).
to
eq
(
1
)
end
it
'handles duplicate queue names'
do
...
...
@@ -109,7 +109,7 @@ RSpec.describe Gitlab::SidekiqCluster do
.
and_return
(
1
)
expect
(
described_class
).
to
receive
(
:wait_async
).
with
(
1
)
expect
(
described_class
.
start_sidekiq
(
%w(foo foo bar baz)
,
options
)).
to
eq
(
1
)
expect
(
described_class
.
start_sidekiq
(
%w(foo foo bar baz)
,
**
options
)).
to
eq
(
1
)
end
it
'runs the sidekiq process in a new process group'
do
...
...
@@ -119,7 +119,7 @@ RSpec.describe Gitlab::SidekiqCluster do
.
and_return
(
1
)
allow
(
described_class
).
to
receive
(
:wait_async
)
expect
(
described_class
.
start_sidekiq
(
%w(foo bar baz)
,
options
)).
to
eq
(
1
)
expect
(
described_class
.
start_sidekiq
(
%w(foo bar baz)
,
**
options
)).
to
eq
(
1
)
end
end
...
...
spec/models/concerns/each_batch_spec.rb
View file @
2bc223c3
...
...
@@ -18,13 +18,13 @@ RSpec.describe EachBatch do
shared_examples
'each_batch handling'
do
|
kwargs
|
it
'yields an ActiveRecord::Relation when a block is given'
do
model
.
each_batch
(
kwargs
)
do
|
relation
|
model
.
each_batch
(
**
kwargs
)
do
|
relation
|
expect
(
relation
).
to
be_a_kind_of
(
ActiveRecord
::
Relation
)
end
end
it
'yields a batch index as the second argument'
do
model
.
each_batch
(
kwargs
)
do
|
_
,
index
|
model
.
each_batch
(
**
kwargs
)
do
|
_
,
index
|
expect
(
index
).
to
eq
(
1
)
end
end
...
...
@@ -32,7 +32,7 @@ RSpec.describe EachBatch do
it
'accepts a custom batch size'
do
amount
=
0
model
.
each_batch
(
kwargs
.
merge
({
of:
1
}))
{
amount
+=
1
}
model
.
each_batch
(
**
kwargs
.
merge
({
of:
1
}))
{
amount
+=
1
}
expect
(
amount
).
to
eq
(
5
)
end
...
...
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