mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
Freeze Messages directly after initialization
This ensures that they are actually immutable.
This commit is contained in:
parent
57f200ab35
commit
667beb662f
@ -53,6 +53,8 @@ module Rackstash
|
||||
@progname = dup_freeze(progname)
|
||||
|
||||
@message = cleanup(message)
|
||||
|
||||
freeze
|
||||
end
|
||||
|
||||
# @return [String] the guman readable label for the {#severity}.
|
||||
|
||||
@ -50,6 +50,10 @@ describe Rackstash::Message do
|
||||
expect(message.message).not_to equal str
|
||||
expect(message.message).to eql str
|
||||
end
|
||||
|
||||
it 'freezes the Message' do
|
||||
expect(described_class.new('message')).to be_frozen
|
||||
end
|
||||
end
|
||||
|
||||
describe '#message' do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user