diff --git a/src/spectator/formatting/broadcast_formatter.cr b/src/spectator/formatting/broadcast_formatter.cr new file mode 100644 index 0000000..3992777 --- /dev/null +++ b/src/spectator/formatting/broadcast_formatter.cr @@ -0,0 +1,13 @@ +require "./formatter" + +module Spectator::Formatting + # Reports events to multiple other formatters. + # Events received by this formatter will be sent to others. + class BroadcastFormatter < Formatter + # Creates the broadcast formatter. + # Takes a collection of formatters to pass events along to. + def initialize(formatters : Enumerable(Formatter)) + @formatters = formatters.to_a + end + end +end diff --git a/src/spectator/formatting/formatter.cr b/src/spectator/formatting/formatter.cr index 784a2ff..125c149 100644 --- a/src/spectator/formatting/formatter.cr +++ b/src/spectator/formatting/formatter.cr @@ -1,8 +1,7 @@ -require "../reporters" - module Spectator::Formatting - abstract class Formatter < Reporters::Reporter - def initialize(@output : IO) - end + # 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 Formatter end end diff --git a/src/spectator/reporters/broadcast_reporter.cr b/src/spectator/reporters/broadcast_reporter.cr deleted file mode 100644 index da4fc36..0000000 --- a/src/spectator/reporters/broadcast_reporter.cr +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index a050e0c..0000000 --- a/src/spectator/reporters/reporter.cr +++ /dev/null @@ -1,7 +0,0 @@ -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