Skip to content

Commit

Permalink
#3793 Make ExpectFailure nested
Browse files Browse the repository at this point in the history
  • Loading branch information
asmirnov-backend committed Jan 9, 2025
1 parent 7ca8e2e commit d813949
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 96 deletions.
32 changes: 32 additions & 0 deletions eo-runtime/src/main/java/org/eolang/Expect.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@ public class Expect<T> {
*/
private final Supplier<T> sup;

/**
* This exception is used to enhance the error message in the {@link Expect#otherwise(String)} method
*
* @since 0.51
*/
private static class ExpectFailureInMust extends ExFailure {
/**
* Ctor.
* @param cause Exception cause
* @param args Arguments for {@link String#format(String, Object...)}
*/
public ExpectFailureInMust(final String cause, final Object... args) {
super(String.format(cause, args));
}
}

/**
* This exception is used to enhance the error message in the {@link Expect#otherwise(String)} method
*
* @since 0.51
*/
private static class ExpectFailureInThat extends ExFailure {
/**
* Ctor.
* @param cause Exception cause
* @param args Arguments for {@link String#format(String, Object...)}
*/
public ExpectFailureInThat(final String cause, final Object... args) {
super(String.format(cause, args));
}
}

/**
* Ctor.
* @param subj The subject
Expand Down
48 changes: 0 additions & 48 deletions eo-runtime/src/main/java/org/eolang/ExpectFailureInMust.java

This file was deleted.

48 changes: 0 additions & 48 deletions eo-runtime/src/main/java/org/eolang/ExpectFailureInThat.java

This file was deleted.

0 comments on commit d813949

Please sign in to comment.