Exemplo n.º 1
0
 public List<TestFile> files(Object... paths) {
   List<TestFile> files = new ArrayList<TestFile>();
   for (Object path : paths) {
     files.add(file(path));
   }
   return files;
 }
Exemplo n.º 2
0
 public List<String> linesThat(Matcher<? super String> matcher) {
   try {
     BufferedReader reader = new BufferedReader(new FileReader(this));
     try {
       List<String> lines = new ArrayList<String>();
       String line;
       while ((line = reader.readLine()) != null) {
         if (matcher.matches(line)) {
           lines.add(line);
         }
       }
       return lines;
     } finally {
       reader.close();
     }
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }