diff --git a/spec/util/vmdb-logger_spec.rb b/spec/util/vmdb-logger_spec.rb index 34ccdae22..3dbc3c609 100644 --- a/spec/util/vmdb-logger_spec.rb +++ b/spec/util/vmdb-logger_spec.rb @@ -96,8 +96,14 @@ end context "long messages" do + before(:each) do + @logger = VMDBLogger.new(@log) + end + it "truncates long messages when max_message_size is set" do - # TODO Add test body! + msg = "a" * 1_572_864 # 1.5 mb in bytes + _, message = @logger.formatter.call(:error, Time.now.utc, "", msg).split("-- : ") + expect(message.strip.size).to eq(1.megabyte) end end