@Test public void shouldNotFailWhenListPluginsWithoutConfig() throws Exception { final Path home = folder.newFolder().toPath(); final Commands commands = new Commands(home); final ConfigOptions options = mock(ConfigOptions.class); when(options.getProfile()).thenReturn("some-profile"); final ExitCode exitCode = commands.listPlugins(options); assertThat(exitCode) .isEqualTo(ExitCode.NO_ERROR); }
@Test public void shouldAllowEmptyReportDirectory() throws Exception { final Path home = folder.newFolder().toPath(); createConfig(home, "allure-test.yml"); final ConfigOptions options = mock(ConfigOptions.class); when(options.getProfile()).thenReturn("test"); final Path reportPath = folder.newFolder().toPath(); final Commands commands = new Commands(home); final ExitCode exitCode = commands.generate(reportPath, Collections.emptyList(), false, options); assertThat(exitCode) .isEqualTo(ExitCode.NO_ERROR); }
@Test public void shouldListPlugins() throws Exception { final Path home = folder.newFolder().toPath(); createConfig(home, "allure-test.yml"); final ConfigOptions options = mock(ConfigOptions.class); when(options.getProfile()).thenReturn("test"); final Commands commands = new Commands(home); final ExitCode exitCode = commands.listPlugins(options); assertThat(exitCode) .isEqualTo(ExitCode.NO_ERROR); }
@Test public void shouldLoadConfig() throws Exception { final Path home = folder.newFolder().toPath(); createConfig(home, "allure-test.yml"); final ConfigOptions options = mock(ConfigOptions.class); when(options.getProfile()).thenReturn("test"); final Commands commands = new Commands(home); final CommandlineConfig config = commands.getConfig(options); assertThat(config) .isNotNull(); assertThat(config.getPlugins()) .hasSize(3) .containsExactly("a", "b", "c"); }