mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 22:10:28 +08:00
1f4aa343d8
Spec file is not being run because it was in the wrong folder.
22 lines
728 B
Ruby
22 lines
728 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe SignalTrapLogger do
|
|
describe "#log" do
|
|
it "should queue up messages to be logged which will then be logged by the logging thread" do
|
|
fake_logger = FakeLogger.new
|
|
|
|
SignalTrapLogger.instance.log(fake_logger, "message 1", level: :error)
|
|
|
|
# Ensures that thread doesn't die even if an error is encountered
|
|
SignalTrapLogger.instance.log(fake_logger, "error", level: :abcdes)
|
|
|
|
SignalTrapLogger.instance.log(fake_logger, "message 2", level: :info)
|
|
|
|
wait_for { fake_logger.errors.size == 1 && fake_logger.infos.size == 1 }
|
|
|
|
expect(fake_logger.errors).to eq(["message 1"])
|
|
expect(fake_logger.infos).to eq(["message 2"])
|
|
end
|
|
end
|
|
end
|