Merge pull request #43 from kemitix/kcr-31-builder-defaultrulereadmeloadertest-fragment-localvariable

KCR31: builder: DefaultRuleReadmeLoaderTest: make field local
This commit is contained in:
Paul Campbell 2017-05-29 13:16:35 +01:00 committed by GitHub
commit b04d131245

View file

@ -23,12 +23,8 @@ public class DefaultRuleReadmeLoaderTest {
private RuleReadmeLoader loader; private RuleReadmeLoader loader;
private TemplateProperties templateProperties;
private Rule rule; private Rule rule;
private Path fragment;
private Path fragments; private Path fragments;
@org.junit.Rule @org.junit.Rule
@ -39,7 +35,7 @@ public class DefaultRuleReadmeLoaderTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
templateProperties = new TemplateProperties(); final TemplateProperties templateProperties = new TemplateProperties();
fragments = folder.newFolder("fragments") fragments = folder.newFolder("fragments")
.toPath(); .toPath();
templateProperties.setReadmeFragments(fragments); templateProperties.setReadmeFragments(fragments);
@ -53,8 +49,8 @@ public class DefaultRuleReadmeLoaderTest {
public void loadEnabledOkay() throws IOException { public void loadEnabledOkay() throws IOException {
//given //given
rule.setEnabled(true); rule.setEnabled(true);
fragment = fragments.resolve("name.md"); final Path fragment1 = fragments.resolve("name.md");
Files.write(fragment, Arrays.asList("", "body")); Files.write(fragment1, Arrays.asList("", "body"));
//when //when
val fragment = loader.load(rule); val fragment = loader.load(rule);
//then //then