Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Test improvement #149

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.rx_cache2.internal;

import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -53,12 +54,8 @@ public void Cache_Directory_Not_Exist() {
@Test(expected = InvalidParameterException.class)
public void Cache_Directory_Not_Writable() {
File cacheDir = new File(temporaryFolder.getRoot(), "non_existent_folder");
if (!cacheDir.mkdirs()) {
throw new IllegalStateException("Cannot create temporary directory");
}
if (!cacheDir.setWritable(false, false)) {
throw new IllegalStateException("Cannot modify permissions");
}
Assume.assumeTrue("Cannot create temporary directory", !cacheDir.mkdirs());
Assume.assumeFalse("Cannot modify permissions", !cacheDir.setWritable(false, false));
new RxCache.Builder()
.persistence(cacheDir, io.rx_cache2.internal.Jolyglot$.newInstance());
}
Expand Down