Make fixture message more descriptive

+ use strip_heredoc to make the text in tests much more readable
This commit is contained in:
Pawel Chojnacki 2017-06-02 14:21:58 +02:00
parent e21b1501ff
commit c86e1437eb
2 changed files with 14 additions and 13 deletions

View File

@ -24,6 +24,6 @@ if envs.any? {|env_name| ENV[env_name].present? }
if ENV['GITLAB_PROMETHEUS_METRICS_ENABLED'].present?
value = Gitlab::Utils.to_boolean(ENV['GITLAB_PROMETHEUS_METRICS_ENABLED'])
settings.prometheus_metrics_enabled = value
save(settings, 'GITLAB_PROMETHEUS_METRICS_ENABLED')
save(settings, 'Prometheus metrics enabled flag')
end
end

View File

@ -11,12 +11,13 @@ describe Gitlab::HealthChecks::PrometheusTextFormat do
end
it 'marshal to text with non repeating type definition' do
expected = <<-EXPECTED
# TYPE metric1 gauge
metric1 1
# TYPE metric2 gauge
metric2 2
EXPECTED
expected = <<-EXPECTED.strip_heredoc
# TYPE metric1 gauge
metric1 1
# TYPE metric2 gauge
metric2 2
EXPECTED
expect(subject.marshal(sample_metrics)).to eq(expected.chomp)
end
@ -30,12 +31,12 @@ EXPECTED
end
it 'marshal to text with non repeating type definition' do
expected = <<-EXPECTED
# TYPE metric1 gauge
metric1 1
metric1 2
# TYPE metric2 gauge
metric2 3
expected = <<-EXPECTED.strip_heredoc
# TYPE metric1 gauge
metric1 1
metric1 2
# TYPE metric2 gauge
metric2 3
EXPECTED
expect(subject.marshal(sample_metrics)).to eq(expected.chomp)
end