Cast values to strings before escaping them
This ensures that e.g. line numbers used in tags are first casted to strings.
This commit is contained in:
parent
9f95ff0d90
commit
5142c61707
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue