aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcgdecker <cgdecker@google.com>2019-05-06 11:59:46 -0700
committerRon Shapiro <shapiro.rd@gmail.com>2019-05-07 11:02:51 -0400
commit964049861bb6da3d3650c1e01b98957a310cd887 (patch)
tree9964a79ff2b9d90f3168c21361e8cfa1cca64c41
parentbd5f3cd72253a6d75c9e4e11482694ff47011e91 (diff)
downloadjimfs-964049861bb6da3d3650c1e01b98957a310cd887.tar.gz
Remove PathSubject.andThat().
RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=246869377
-rw-r--r--jimfs/src/test/java/com/google/common/jimfs/JimfsUnixLikeFileSystemTest.java21
-rw-r--r--jimfs/src/test/java/com/google/common/jimfs/PathSubject.java12
2 files changed, 7 insertions, 26 deletions
diff --git a/jimfs/src/test/java/com/google/common/jimfs/JimfsUnixLikeFileSystemTest.java b/jimfs/src/test/java/com/google/common/jimfs/JimfsUnixLikeFileSystemTest.java
index 2d0da68..a839d6a 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/JimfsUnixLikeFileSystemTest.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/JimfsUnixLikeFileSystemTest.java
@@ -1813,26 +1813,19 @@ public class JimfsUnixLikeFileSystemTest extends AbstractJimfsIntegrationTest {
Object fooKey = getFileKey("/foo");
Files.move(path("/foo"), path("/bar"));
- assertThatPath("/foo")
- .doesNotExist()
- .andThat("/bar")
- .containsBytes(bytes)
- .and()
- .attribute("fileKey")
- .is(fooKey);
+ assertThatPath("/foo").doesNotExist();
+ assertThatPath("/bar").containsBytes(bytes).and().attribute("fileKey").is(fooKey);
Files.createDirectory(path("/foo"));
Files.move(path("/bar"), path("/foo/bar"));
- assertThatPath("/bar").doesNotExist().andThat("/foo/bar").isRegularFile();
+ assertThatPath("/bar").doesNotExist();
+ assertThatPath("/foo/bar").isRegularFile();
Files.move(path("/foo"), path("/baz"));
- assertThatPath("/foo")
- .doesNotExist()
- .andThat("/baz")
- .isDirectory()
- .andThat("/baz/bar")
- .isRegularFile();
+ assertThatPath("/foo").doesNotExist();
+ assertThatPath("/baz").isDirectory();
+ assertThatPath("/baz/bar").isRegularFile();
}
@Test
diff --git a/jimfs/src/test/java/com/google/common/jimfs/PathSubject.java b/jimfs/src/test/java/com/google/common/jimfs/PathSubject.java
index ea733eb..2e892db 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/PathSubject.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/PathSubject.java
@@ -68,18 +68,6 @@ public final class PathSubject extends Subject<PathSubject, Path> {
return this;
}
- /**
- * Returns a new subject for asserting against a different path or with different link options.
- */
- // TODO(cgruber): Talk to cdecker about removing this as an anti-pattern.
- public PathSubject andThat(String path, LinkOption... linkOptions) {
- PathSubject newSubject = check("path(%s", path).about(paths()).that(toPath(path));
- if (linkOptions.length != 0) {
- newSubject = newSubject.noFollowLinks();
- }
- return newSubject;
- }
-
/** Do not follow links when looking up the path. */
public PathSubject noFollowLinks() {
this.linkOptions = NOFOLLOW_LINKS;