FeatureSection implements Section { @Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { final FeatureRenderer renderer = FeatureSection.featureRenderer.get(); renderer.setI18n(i18n); renderer.setDocumentAttributes(documentAttributes); return renderer.renderFeature(feature, docBuilder); } FeatureSection(Feature feature); @Override Section addFeature(Feature feature); @Override String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes); @Override int getOrder(); @Override Stream<Feature> getFeatures();  }
@Test public void shouldRender() { final Feature feature = FeatureBuilder.instance().aFeatureWithNoScenarios(); final FeatureSection section = new FeatureSection(feature); final String expected = "[[Feature-name, Feature name]]" + newLine() + "= *Feature name*" + newLine() + newLine() + newLine() + "Feature description" + newLine() + newLine(); final String result = section.render(CukedoctorDocumentBuilder.Factory.newInstance(), I18nLoader.instance(null), new DocumentAttributes()); assertEquals(expected, result); }