mirror of
https://github.com/meineerde/rackstash.git
synced 2025-12-19 15:01:12 +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.
|
# @return [Fields::Tags] the resolved tags which are set on the buffer.
|
||||||
# All strings are frozen.
|
# All strings are frozen.
|
||||||
def tag(*new_tags, scope: nil)
|
def tag(*new_tags, scope: nil)
|
||||||
|
timestamp
|
||||||
tags.merge!(new_tags, scope: scope)
|
tags.merge!(new_tags, scope: scope)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -429,6 +429,11 @@ describe Rackstash::Buffer do
|
|||||||
expect(buffer.tags).to contain_exactly('tag')
|
expect(buffer.tags).to contain_exactly('tag')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'sets the timestamp' do
|
||||||
|
expect(buffer).to receive(:timestamp)
|
||||||
|
buffer.tag('hello')
|
||||||
|
end
|
||||||
|
|
||||||
describe 'when passing procs' do
|
describe 'when passing procs' do
|
||||||
let(:struct) {
|
let(:struct) {
|
||||||
Struct.new(:value) do
|
Struct.new(:value) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user