Commit 124e4c4f authored by Piotr Skorupa's avatar Piotr Skorupa

Make rubocop happy

- Use instance variables
- Remove redundant one-character regex classes
parent 5901dcac
...@@ -42,7 +42,7 @@ module Gitlab ...@@ -42,7 +42,7 @@ module Gitlab
end end
def definitions(skip_validation: false) def definitions(skip_validation: false)
@@skip_validation = skip_validation @skip_validation = skip_validation
@definitions ||= load_all! @definitions ||= load_all!
end end
...@@ -88,7 +88,7 @@ module Gitlab ...@@ -88,7 +88,7 @@ module Gitlab
end end
def skip_validation? def skip_validation?
!!attributes[:skip_validation] || @@skip_validation !!attributes[:skip_validation] || @skip_validation
end end
end end
end end
......
...@@ -13,14 +13,14 @@ RSpec.describe Gitlab::UsageMetricDefinition::RedisHllGenerator do ...@@ -13,14 +13,14 @@ RSpec.describe Gitlab::UsageMetricDefinition::RedisHllGenerator do
before do before do
stub_const("#{Gitlab::UsageMetricDefinitionGenerator}::TOP_LEVEL_DIR", temp_dir) stub_const("#{Gitlab::UsageMetricDefinitionGenerator}::TOP_LEVEL_DIR", temp_dir)
# Stub Prometheus requests from Gitlab::Utils::UsageData # Stub Prometheus requests from Gitlab::Utils::UsageData
stub_request(:get, %r{^http[s]?://::1:9090/-/ready}) stub_request(:get, %r{^https?://::1:9090/-/ready})
.to_return( .to_return(
status: 200, status: 200,
body: [{}].to_json, body: [{}].to_json,
headers: { 'Content-Type' => 'application/json' } headers: { 'Content-Type' => 'application/json' }
) )
stub_request(:get, %r{^http[s]?://::1:9090/api/v1/query\?query=.*}) stub_request(:get, %r{^https?://::1:9090/api/v1/query\?query=.*})
.to_return( .to_return(
status: 200, status: 200,
body: [{}].to_json, body: [{}].to_json,
......
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