/** Tests {@link Version}. */ @RunWith(JUnit4.class) public class VersionTest { @Rule public final Std stdOut = Std.out(); @Test public void whenInvoked_getVersion_returnsCurrentVersion() throws Exception { // run + assert assertThat(Version.getVersion()).contains("1.1.0"); } @Test public void whenInvokedWithoutArguments_main_printsCurrentVersionToStdOut() throws Exception { // setup final String[] args = new String[0]; // run Version.main(args); // assert assertThat(stdOut.getContent()).contains("1.1.0"); } @Test public void whenInvokedWithArguments_main_printsProjectNameAndCurrentVersionToStdOut() throws Exception { // setup final String[] args = new String[] {"arg1"}; // run Version.main(args); // assert assertThat(stdOut.getContent()).contains("tinybinding 1.1.0"); } }
@Test public void whenInvokedWithoutArguments_main_printsCurrentVersionToStdOut() throws Exception { // setup final String[] args = new String[0]; // run Version.main(args); // assert assertThat(stdOut.getContent()).contains("1.1.0"); }
@Test public void whenInvokedWithArguments_main_printsProjectNameAndCurrentVersionToStdOut() throws Exception { // setup final String[] args = new String[] {"arg1"}; // run Version.main(args); // assert assertThat(stdOut.getContent()).contains("tinybinding 1.1.0"); }