Commit 59af4a88 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'fix-ruby-2.7-warnings-in-kubernetes_helpers' into 'master'

Fix ruby 2.7 warnings in spec/support/helpers

See merge request gitlab-org/gitlab!44467
parents 1014a0a3 7218b83d
......@@ -75,11 +75,9 @@ RSpec.describe Clusters::Kubernetes::FetchKubernetesTokenService do
before do
stub_kubeclient_get_secret_missing_token_then_with_token(
api_url,
{
metadata_name: service_account_token_name,
namespace: namespace,
token: token
}
)
end
......
......@@ -126,17 +126,15 @@ module CycleAnalyticsHelpers
end
def mock_gitaly_multi_action_dates(repository, commit_time)
allow(repository.raw).to receive(:multi_action).and_wrap_original do |m, *args|
allow(repository.raw).to receive(:multi_action).and_wrap_original do |m, user, kargs|
new_date = commit_time || Time.now
branch_update = m.call(*args)
branch_update = m.call(user, **kargs)
if branch_update.newrev
_, opts = args
commit = rugged_repo(repository).rev_parse(branch_update.newrev)
branch_update.newrev = commit.amend(
update_ref: "#{Gitlab::Git::BRANCH_REF_PREFIX}#{opts[:branch_name]}",
update_ref: "#{Gitlab::Git::BRANCH_REF_PREFIX}#{kargs[:branch_name]}",
author: commit.author.merge(time: new_date),
committer: commit.committer.merge(time: new_date)
)
......
......@@ -23,7 +23,7 @@ module GraphqlHelpers
return early_return unless ready
resolver.resolve(args)
resolver.resolve(**args)
end
# Eagerly run a loader's named resolver
......
......@@ -167,7 +167,7 @@ module KubernetesHelpers
options[:namespace] ||= "default"
WebMock.stub_request(:get, api_url + "/api/v1/namespaces/#{options[:namespace]}/secrets/#{options[:metadata_name]}")
.to_return(kube_response(kube_v1_secret_body(**options)))
.to_return(kube_response(kube_v1_secret_body(options)))
end
def stub_kubeclient_get_secret_error(api_url, name, namespace: 'default', status: 404)
......@@ -265,7 +265,7 @@ module KubernetesHelpers
.to_return(kube_response({}))
end
def kube_v1_secret_body(**options)
def kube_v1_secret_body(options)
{
"kind" => "SecretList",
"apiVersion": "v1",
......
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