/** * Returns a {@link StringSubject} that makes assertions about the contents of the actual file as * a string. */ public StringSubject contentsAsString(Charset charset) { try { return check() .that(JavaFileObjects.asByteSource(actual()).asCharSource(charset).read()) .named("the contents of " + actualAsString()); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Returns a {@link StringSubject} that makes assertions about the contents of the actual file as * a string. */ public StringSubject contentsAsString(Charset charset) { try { return check() .that(JavaFileObjects.asByteSource(actual()).asCharSource(charset).read()) .named("the contents of " + actualAsString()); } catch (IOException e) { throw new RuntimeException(e); } }