BigW Consortium Gitlab

Commit 5142c617 by Yorick Peterse

Cast values to strings before escaping them

This ensures that e.g. line numbers used in tags are first casted to strings.
parent 9f95ff0d
......@@ -24,6 +24,6 @@ class MetricsWorker
end
def escape_value(value)
value.gsub('=', '\\=')
value.to_s.gsub('=', '\\=')
end
end
......@@ -36,5 +36,9 @@ describe MetricsWorker do
it 'escapes an equals sign' do
expect(worker.escape_value('foo=')).to eq('foo\\=')
end
it 'casts values to Strings' do
expect(worker.escape_value(10)).to eq('10')
end
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