// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> contains(String fileName) {
//     return new DirectoryContains(fileName);
// }
// 
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> exists(LinkOption... options) {
//     return new Exists(options);
// }
// 
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> hasFilesCount(int expectedCount) {
//     return new FilesCount(expectedCount);
// }
// 
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> isDirectory() {
//     return new IsDirectory();
// }


import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static ru.yandex.qatools.matchers.nio.PathMatchers.contains;
import static ru.yandex.qatools.matchers.nio.PathMatchers.exists;
import static ru.yandex.qatools.matchers.nio.PathMatchers.hasFilesCount;
import static ru.yandex.qatools.matchers.nio.PathMatchers.isDirectory;
package ru.yandex.qatools.matchers.nio;




/**
 * @author Dmitry Baev charlie@yandex-team.ru
 *         Date: 09.10.15
 */
public class PathMatchersTest {

    @Rule
    public TemporaryFolder folder = new TemporaryFolder();

    private Path directory;

    @Before
    public void setUp() throws Exception {
        directory = folder.newFolder().toPath();
    }

    @Test
    public void shouldContains() throws Exception {
        Files.write(directory.resolve("file"), "content".getBytes(StandardCharsets.UTF_8));
        assertThat(directory, contains("file"));
    }

    @Test(expected = AssertionError.class)
    public void shouldFailIfNotContains() throws Exception {
        assertThat(directory, contains("file"));
    }

    @Test
    public void shouldNotContains() throws Exception {
        assertThat(directory, not(contains("file")));
    }

    @Test
    public void shouldIsDirectory() throws Exception {
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> contains(String fileName) {
//     return new DirectoryContains(fileName);
// }
// 
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> exists(LinkOption... options) {
//     return new Exists(options);
// }
// 
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> hasFilesCount(int expectedCount) {
//     return new FilesCount(expectedCount);
// }
// 
// Path: nio-matchers/src/main/java/ru/yandex/qatools/matchers/nio/PathMatchers.java
// @Factory
// public static Matcher<Path> isDirectory() {
//     return new IsDirectory();
// }


// Path: nio-matchers/src/test/java/ru/yandex/qatools/matchers/nio/PathMatchersTest.java
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static ru.yandex.qatools.matchers.nio.PathMatchers.contains;
import static ru.yandex.qatools.matchers.nio.PathMatchers.exists;
import static ru.yandex.qatools.matchers.nio.PathMatchers.hasFilesCount;
import static ru.yandex.qatools.matchers.nio.PathMatchers.isDirectory;

package ru.yandex.qatools.matchers.nio;




/**
 * @author Dmitry Baev charlie@yandex-team.ru
 *         Date: 09.10.15
 */
public class PathMatchersTest {

    @Rule
    public TemporaryFolder folder = new TemporaryFolder();

    private Path directory;

    @Before
    public void setUp() throws Exception {
        directory = folder.newFolder().toPath();
    }

    @Test
    public void shouldContains() throws Exception {
        Files.write(directory.resolve("file"), "content".getBytes(StandardCharsets.UTF_8));
        assertThat(directory, contains("file"));
    }

    @Test(expected = AssertionError.class)
    public void shouldFailIfNotContains() throws Exception {
        assertThat(directory, contains("file"));
    }

    @Test
    public void shouldNotContains() throws Exception {
        assertThat(directory, not(contains("file")));
    }

    @Test
    public void shouldIsDirectory() throws Exception {
        assertThat(directory, isDirectory());