From f3afd74dc57deae16aa2207f31127ea4b18b408e Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 6 May 2021 22:10:59 -0600 Subject: [PATCH] Empty classes for reporting --- src/spectator/reporters/broadcast_reporter.cr | 13 +++++++++++++ src/spectator/reporters/reporter.cr | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 src/spectator/reporters/broadcast_reporter.cr create mode 100644 src/spectator/reporters/reporter.cr diff --git a/src/spectator/reporters/broadcast_reporter.cr b/src/spectator/reporters/broadcast_reporter.cr new file mode 100644 index 0000000..da4fc36 --- /dev/null +++ b/src/spectator/reporters/broadcast_reporter.cr @@ -0,0 +1,13 @@ +require "./reporter" + +module Spectator::Reporters + # Reports events to multiple other reporters. + # Events received by this reporter will be sent to others. + class BroadcastReporter < Reporter + # Creates the broadcast reporter. + # Takes a collection of reporters to pass events along to. + def initialize(reporters : Enumerable(Reporter)) + @reporters = reporters.to_a + end + end +end diff --git a/src/spectator/reporters/reporter.cr b/src/spectator/reporters/reporter.cr new file mode 100644 index 0000000..a050e0c --- /dev/null +++ b/src/spectator/reporters/reporter.cr @@ -0,0 +1,7 @@ +module Spectator::Reporters + # Base class and interface used to notify systems of events. + # This is typically used for producing output from test results, + # but can also be used to send data to external systems. + abstract class Reporter + end +end