Skip to content

Commit

Permalink
Made core tests pass on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy authored and unknown committed Aug 19, 2011
1 parent 93475e4 commit f0bc25e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/cucumber/io/FileResource.java
Expand Up @@ -17,7 +17,7 @@ public FileResource(File rootDir, File file) {
}

public String getPath() {
return file.getAbsolutePath().substring(rootDir.getAbsolutePath().length() + 1, file.getAbsolutePath().length());
return file.getAbsolutePath().substring(rootDir.getAbsolutePath().length() + 1, file.getAbsolutePath().length()).replace(File.separatorChar, '/');
}

public InputStream getInputStream() {
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/java/cucumber/runtime/ClasspathTest.java
Expand Up @@ -29,13 +29,16 @@ public void looksUpInstantiableSubclassesOnClassPath() throws IOException {

@Test
public void looksUpFilesByDir() throws IOException {
final List<Resource> resources = new ArrayList<Resource>();
final List<String> paths = new ArrayList<String>();
Classpath.scan("cucumber/runtime", ".xyz", new Consumer() {
public void consume(Resource resource) {
paths.add(resource.getPath());
resources.add(resource);
}
});
assertEquals(Arrays.asList("cucumber/runtime/bar.xyz", "cucumber/runtime/foo.xyz"), paths);
assertEquals("BAR", resources.get(0).getString());
}

@Test
Expand Down
1 change: 1 addition & 0 deletions core/src/test/resources/cucumber/runtime/bar.xyz
@@ -0,0 +1 @@
BAR
1 change: 1 addition & 0 deletions core/src/test/resources/cucumber/runtime/foo.xyz
@@ -0,0 +1 @@
FOO

0 comments on commit f0bc25e

Please sign in to comment.