mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
Set the Buffer's timestamp when setting a tag
This commit is contained in:
parent
ff50daf1eb
commit
78466f9439
@ -252,6 +252,7 @@ module Rackstash
|
||||
# @return [Fields::Tags] the resolved tags which are set on the buffer.
|
||||
# All strings are frozen.
|
||||
def tag(*new_tags, scope: nil)
|
||||
timestamp
|
||||
tags.merge!(new_tags, scope: scope)
|
||||
end
|
||||
|
||||
|
||||
@ -429,6 +429,11 @@ describe Rackstash::Buffer do
|
||||
expect(buffer.tags).to contain_exactly('tag')
|
||||
end
|
||||
|
||||
it 'sets the timestamp' do
|
||||
expect(buffer).to receive(:timestamp)
|
||||
buffer.tag('hello')
|
||||
end
|
||||
|
||||
describe 'when passing procs' do
|
||||
let(:struct) {
|
||||
Struct.new(:value) do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user