Skip to content

Commit

Permalink
Stop calling it Truth's "new" failure API.
Browse files Browse the repository at this point in the history
It's been quite a while now :) And probably this has been the _only_ API available in open-source for quite a while, too.

RELNOTES=n/a
PiperOrigin-RevId: 488356909
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Nov 14, 2022
1 parent edb3a8d commit 9971b0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public TruthFailureSubject createSubject(FailureMetadata metadata, AssertionErro
/** Returns a subject for the list of fact keys. */
public IterableSubject factKeys() {
if (!(actual instanceof ErrorWithFacts)) {
failWithActual(simpleFact("expected a failure thrown by Truth's new failure API"));
failWithActual(simpleFact("expected a failure thrown by Truth's failure API"));
return ignoreCheck().that(ImmutableList.of());
}
ErrorWithFacts error = (ErrorWithFacts) actual;
Expand Down Expand Up @@ -124,7 +124,7 @@ public StringSubject factValue(String key, int index) {
private StringSubject doFactValue(String key, @Nullable Integer index) {
checkNotNull(key);
if (!(actual instanceof ErrorWithFacts)) {
failWithActual(simpleFact("expected a failure thrown by Truth's new failure API"));
failWithActual(simpleFact("expected a failure thrown by Truth's failure API"));
return ignoreCheck().that("");
}
ErrorWithFacts error = (ErrorWithFacts) actual;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ public void factValueIntFailNoValue() {
@Test
public void nonTruthErrorFactKeys() {
Object unused = expectFailureWhenTestingThat(new AssertionError()).factKeys();
assertFailureKeys("expected a failure thrown by Truth's new failure API", "but was");
assertFailureKeys("expected a failure thrown by Truth's failure API", "but was");
}

@Test
public void nonTruthErrorFactValue() {
Object unused = expectFailureWhenTestingThat(new AssertionError()).factValue("foo");
assertFailureKeys("expected a failure thrown by Truth's new failure API", "but was");
assertFailureKeys("expected a failure thrown by Truth's failure API", "but was");
}

private TruthFailureSubject assertThat(Fact... facts) {
Expand Down

0 comments on commit 9971b0d

Please sign in to comment.