JBehave
  1. JBehave
  2. JBEHAVE-550

StoryReporterBuilder does not have an easy way to provide custom StoryReporter(s)

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.5
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I recently wanted to add my own StoryReporter to every story and found it quite difficult.

      It would be great if StoryReporterBuilder could have one of the following methods added
      withStoryReporters(StoryReporter... storyReporters)
      addStoryReporter(StoryReporter storyReporter)

      The only way I could find was to override StoryReporterBuilder.build(String storyPath) and use a DelegatingStoryReporter to include my custom storyReporter(s).

        Activity

        Hide
        Mauro Talevi added a comment -

        The StoryReporterBuilder provides the method withFormats(Formats...) for this purpose. The Format implementation allows you to create your instance of StoryReporter.

        Show
        Mauro Talevi added a comment - The StoryReporterBuilder provides the method withFormats(Formats...) for this purpose. The Format implementation allows you to create your instance of StoryReporter.
        Hide
        Lance added a comment -

        Ah... I did see Format but the name was misleading. Perhaps StoryReporterSource is a better name?

        Show
        Lance added a comment - Ah... I did see Format but the name was misleading. Perhaps StoryReporterSource is a better name?
        Hide
        Lance added a comment -

        Looking at the Format class it seems like a bit of an odd fit. My StoryReporter had nothing to do with outputting a report and has no reason to be associated with a FilePrintStreamFactory. I stand by my original request.

        Show
        Lance added a comment - Looking at the Format class it seems like a bit of an odd fit. My StoryReporter had nothing to do with outputting a report and has no reason to be associated with a FilePrintStreamFactory. I stand by my original request.
        Hide
        Lance added a comment -

        As suggested by Mauro Talevi, the Format class is sufficient.

        Show
        Lance added a comment - As suggested by Mauro Talevi, the Format class is sufficient.
        Lance made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Lance
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: