Skip to content

Commit

Permalink
Added spec test to check msg is truncated to 1.megabyte
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Cheal committed Nov 21, 2017
1 parent ad4fb78 commit 921f694
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/util/vmdb-logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 921f694

Please sign in to comment.