@Test public void shouldRenderFeatureScenariosOmittingTagsIfOrderFeatureTagIsTheOnlyTag() { final Feature feature = FeatureBuilder.instance().aFeatureWithTwoScenarios(); final String orderTagName = "@order-42"; feature.getTags().add(new Tag(orderTagName)); for (Scenario scenario : feature.getScenarios()) { ScenarioBuilder.instance(scenario).tag(new Tag(orderTagName)); } CukedoctorScenarioRenderer scenarioRenderer = new CukedoctorScenarioRenderer(); scenarioRenderer = spy(scenarioRenderer); doReturn("").when(scenarioRenderer).renderScenarioSteps(anyListOf(Step.class), any(Scenario.class), any(Feature.class)); doReturn("").when(scenarioRenderer).renderScenarioExamples(any(Scenario.class)); CukedoctorFeatureRenderer featureRenderer = new CukedoctorFeatureRenderer(); featureRenderer = spy(featureRenderer); featureRenderer.scenarioRenderer = scenarioRenderer; String resultDoc = featureRenderer.renderFeatureScenarios(feature, new CukedoctorDocumentBuilderImpl().createNestedBuilder().createNestedBuilder()); assertThat(resultDoc).isEqualTo("==== Scenario: scenario 1" + newLine() + "description" + newLine() + newLine() + "==== Scenario: scenario 2" + newLine() + "description 2" + newLine() + newLine()); }
protected String renderFeatureScenarios(Feature feature, CukedoctorDocumentBuilder builder) { StringBuilder sb = new StringBuilder(); for (Scenario scenario : feature.getScenarios()) { sb.append(renderFeatureScenario(scenario, feature, builder)); } feature.setBackgroundRendered(false); return sb.toString(); }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureScenarios(Feature feature, CukedoctorDocumentBuilder builder) { StringBuilder sb = new StringBuilder(); for (Scenario scenario : feature.getScenarios()) { sb.append(renderFeatureScenario(scenario, feature, builder)); } feature.setBackgroundRendered(false); return sb.toString(); } }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureScenarios(Feature feature, CukedoctorDocumentBuilder builder) { StringBuilder sb = new StringBuilder(); for (Scenario scenario : feature.getScenarios()) { sb.append(renderFeatureScenario(scenario, feature, builder)); } feature.setBackgroundRendered(false); return sb.toString(); } CukedoctorFeatureRenderer();  CukedoctorFeatureRenderer(DocumentAttributes documentAttributes);  CukedoctorFeatureRenderer(CukedoctorConfig cukedoctorConfig); }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureScenarios(Feature feature, CukedoctorDocumentBuilder builder) { StringBuilder sb = new StringBuilder(); for (Scenario scenario : feature.getScenarios()) { sb.append(renderFeatureScenario(scenario, feature, builder)); } feature.setBackgroundRendered(false); return sb.toString(); } CukedoctorFeatureRenderer();  CukedoctorFeatureRenderer(DocumentAttributes documentAttributes);  CukedoctorFeatureRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderFeature(Feature feature); @Override String renderFeatures(List<Feature> features); }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureScenarios(Feature feature, CukedoctorDocumentBuilder builder) { StringBuilder sb = new StringBuilder(); for (Scenario scenario : feature.getScenarios()) { sb.append(renderFeatureScenario(scenario, feature, builder)); } feature.setBackgroundRendered(false); return sb.toString(); } CukedoctorFeatureRenderer();  CukedoctorFeatureRenderer(DocumentAttributes documentAttributes);  CukedoctorFeatureRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderFeature(Feature feature); @Override String renderFeatures(List<Feature> features);  }