Skip to content

Commit

Permalink
Merge pull request #1963 from devinbileck/resolve-BisqHelpFormatterTe…
Browse files Browse the repository at this point in the history
…st-failure-on-Windows

Resolve BisqHelpFormatterTest failure on Windows
  • Loading branch information
ManfredKarrer authored Nov 25, 2018
2 parents 61deb05 + 054f293 commit f8b633d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/src/test/java/bisq/core/app/BisqHelpFormatterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void testHelpFormatter() throws IOException, URISyntaxException {
"Application data directory")
.withRequiredArg()
.ofType(File.class)
.defaultsTo(new File("/Users/cbeams/Library/Applicaton Support/Bisq"));
.defaultsTo(new File("/Users/cbeams/Library/Application Support/Bisq"));

parser.accepts("enum-opt",
"Some option that accepts an enum value as an argument")
Expand All @@ -124,6 +124,9 @@ public void testHelpFormatter() throws IOException, URISyntaxException {

ByteArrayOutputStream actual = new ByteArrayOutputStream();
String expected = new String(Files.readAllBytes(Paths.get(getClass().getResource("cli-output.txt").toURI())));
if (System.getProperty("os.name").startsWith("Windows")) {
expected = new String(Files.readAllBytes(Paths.get(getClass().getResource("cli-output_windows.txt").toURI())));
}

parser.printHelpOn(new PrintStream(actual));
assertThat(actual.toString(), equalTo(expected));
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/resources/bisq/core/app/cli-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Options:
--with-default-value=<String> (default: Wat)
Some option with a default value

--data-dir=<File> (default: /Users/cbeams/Library/Applicaton Support/Bisq)
--data-dir=<File> (default: /Users/cbeams/Library/Application Support/Bisq)
Application data directory

--enum-opt=<foo|bar|baz> (default: foo)
Expand Down
57 changes: 57 additions & 0 deletions core/src/test/resources/bisq/core/app/cli-output_windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Bisq Test version 0.1.0

Usage: bisq-test [options]

Options:

--name=<String> (default: Bisq)
The name of the Bisq node

--another-option=<String> (default: WAT)
This is a long description which will need to break over multiple
linessssssssssss such that no line is longer than 80 characters in the
help output.

--exactly-72-char-description=<String>
012345678911234567892123456789312345678941234567895123456789612345678971

--exactly-72-char-description-with-spaces=<String>
123456789 123456789 123456789 123456789 123456789 123456789 123456789 1

--90-char-description-without-spaces=<String>
-123456789-223456789-323456789-423456789-523456789-623456789-723456789-823456789-923456789

--90-char-description-with-space-at-char-80=<String>
-123456789-223456789-323456789-423456789-523456789-623456789-723456789-823456789
923456789

--90-char-description-with-spaces-at-chars-5-and-80=<String>
-123
56789-223456789-323456789-423456789-523456789-623456789-723456789-823456789
923456789

--90-char-description-with-space-at-char-73=<String>
-123456789-223456789-323456789-423456789-523456789-623456789-723456789-8
3456789-923456789

--1-char-description-with-only-a-space=<String>

--empty-description=<String>

--no-description=<String>

--no-arg
Some description

--optional-arg=<value>
Option description

--with-default-value=<String> (default: Wat)
Some option with a default value

--data-dir=<File> (default: \Users\cbeams\Library\Application Support\Bisq)
Application data directory

--enum-opt=<foo|bar|baz> (default: foo)
Some option that accepts an enum value as an argument

0 comments on commit f8b633d

Please sign in to comment.