@VisibleForTesting static void generate(CliConfiguration config) { ConjureDefinition definition = Conjure.parse(config.inputFiles()); try { OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValue(config.outputIrFile(), definition); } catch (IOException e) { throw new RuntimeException("Failed to serialize IR file to " + config.outputIrFile(), e); } }
@Test public void prove_readme_example_is_valid_conjure() throws IOException { Path path = folder.getRoot().toPath().resolve("example1.yml"); Files.write(path, extractSnippetFromReadme().getBytes(StandardCharsets.UTF_8)); Conjure.parse(ImmutableList.of(path.toFile())); }