@Test public void testGitIgnoreCreate() throws Exception { executeGitIgnoreCreate(); GitIgnoreResource gitignore = gitIgnoreResource(); assertTrue(gitignore.exists()); String content = Streams.toString(gitignore.getResourceInputStream()); assertTrue(content.contains(".settings/")); }
@Test public void testGitIgnoreAddPattern() throws Exception { executeGitIgnoreCreate(); CommandController gitIgnoreAddPatternTester = testHarness.createCommandController(GitIgnoreAddPatternCommand.class, project.getRoot()); gitIgnoreAddPatternTester.initialize(); gitIgnoreAddPatternTester.setValueFor("pattern", "*.forge"); gitIgnoreAddPatternTester.execute(); GitIgnoreResource gitignore = gitIgnoreResource(); String content = Streams.toString(gitignore.getResourceInputStream()); assertTrue(content.contains("*.forge")); }
protected String fetch(String type, String example) throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream(OUTPUT + type + "/" + example); return Streams.toString(is, DEFAULT_CHARSET); }