-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- F *breaking change* Introduce InlineOptions
- Loading branch information
1 parent
50e03d8
commit 9d34713
Showing
4 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
approvaltests/src/main/java/org/approvaltests/inline/InlineOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.approvaltests.inline; | ||
|
||
import org.approvaltests.core.Options; | ||
|
||
public interface InlineOptions | ||
{ | ||
Options apply(Options options); | ||
public static InlineOptions showCode(boolean doShowCode) | ||
{ | ||
if (doShowCode) | ||
{ | ||
return new ShowCodeInlineOptions(); | ||
} | ||
else | ||
{ | ||
return new DoNotShowCodeInlineOptions(); | ||
} | ||
} | ||
public static class ShowCodeInlineOptions implements InlineOptions | ||
{ | ||
public Options apply(Options options) | ||
{ | ||
return options.withReporter(new InlineJavaReporter(options.getReporter())); | ||
} | ||
} | ||
public static class DoNotShowCodeInlineOptions implements InlineOptions | ||
{ | ||
public Options apply(Options options) | ||
{ | ||
return options; | ||
} | ||
} | ||
} |