1
0
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:
Holger Just 2017-07-21 22:48:39 +02:00
parent 57f200ab35
commit 667beb662f
2 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,8 @@ module Rackstash
@progname = dup_freeze(progname)
@message = cleanup(message)
freeze
end
# @return [String] the guman readable label for the {#severity}.

View File

@ -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