Commit c86e1437 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Make fixture message more descriptive

+ use strip_heredoc to make the text in tests much more readable
parent e21b1501
...@@ -24,6 +24,6 @@ if envs.any? {|env_name| ENV[env_name].present? } ...@@ -24,6 +24,6 @@ if envs.any? {|env_name| ENV[env_name].present? }
if ENV['GITLAB_PROMETHEUS_METRICS_ENABLED'].present? if ENV['GITLAB_PROMETHEUS_METRICS_ENABLED'].present?
value = Gitlab::Utils.to_boolean(ENV['GITLAB_PROMETHEUS_METRICS_ENABLED']) value = Gitlab::Utils.to_boolean(ENV['GITLAB_PROMETHEUS_METRICS_ENABLED'])
settings.prometheus_metrics_enabled = value settings.prometheus_metrics_enabled = value
save(settings, 'GITLAB_PROMETHEUS_METRICS_ENABLED') save(settings, 'Prometheus metrics enabled flag')
end end
end end
...@@ -11,12 +11,13 @@ describe Gitlab::HealthChecks::PrometheusTextFormat do ...@@ -11,12 +11,13 @@ describe Gitlab::HealthChecks::PrometheusTextFormat do
end end
it 'marshal to text with non repeating type definition' do it 'marshal to text with non repeating type definition' do
expected = <<-EXPECTED expected = <<-EXPECTED.strip_heredoc
# TYPE metric1 gauge # TYPE metric1 gauge
metric1 1 metric1 1
# TYPE metric2 gauge # TYPE metric2 gauge
metric2 2 metric2 2
EXPECTED EXPECTED
expect(subject.marshal(sample_metrics)).to eq(expected.chomp) expect(subject.marshal(sample_metrics)).to eq(expected.chomp)
end end
...@@ -30,12 +31,12 @@ EXPECTED ...@@ -30,12 +31,12 @@ EXPECTED
end end
it 'marshal to text with non repeating type definition' do it 'marshal to text with non repeating type definition' do
expected = <<-EXPECTED expected = <<-EXPECTED.strip_heredoc
# TYPE metric1 gauge # TYPE metric1 gauge
metric1 1 metric1 1
metric1 2 metric1 2
# TYPE metric2 gauge # TYPE metric2 gauge
metric2 3 metric2 3
EXPECTED EXPECTED
expect(subject.marshal(sample_metrics)).to eq(expected.chomp) expect(subject.marshal(sample_metrics)).to eq(expected.chomp)
end end
......
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