Skip to content

Commit

Permalink
unit test to show decoding issue when the location contains a + char
Browse files Browse the repository at this point in the history
due to URLDecode.decode
  • Loading branch information
alexlehm committed Mar 11, 2012
1 parent a45988c commit b379d21
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.jbehave.core.io;

import java.net.MalformedURLException;
import java.net.URL;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;

public class LoadFromRelativeFileTest {

@Test
public void testLoadFromRelativeFile() throws MalformedURLException {
URL baseLocation = CodeLocations.codeLocationFromClass(LoadFromRelativeFileTest.class);
URL subdir=new URL(baseLocation.toString()+"/test+dir");
LoadFromRelativeFile load = new LoadFromRelativeFile(subdir);
String storyText=load.loadStoryAsText("dummy.story");
assertThat(storyText, equalTo("dummy story file"));
}

}
1 change: 1 addition & 0 deletions jbehave-core/src/test/resources/test+dir/dummy.story
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy story file

0 comments on commit b379d21

Please sign in to comment.