Hello,
i wrote some stories and in one i use the GivenStories Keyword.
My project-structure looks like:
...
src/main/java
/jbehave.config
/*.java
/ExampleRunStories.java
/jbehave.steps
/*.java
src/main/resouces
/spec
/*.story
...
In the story i wrote:
GivenStories: spec/MeineGeschichte.story, ...
With that jbehave doesnt find the story. I test also some variations:
**/spec/MeineGeschichte.story ... /spec/MeineGeschichte.story and so on but
nothing works.
So i implement a class to extend LoadFromClasspath and override loadStoryAsText.
{code}
public class MyLoadFromClasspath extends LoadFromClasspath {
public MyLoadFromClasspath(Class<?> classe) {
super(classe);
}
/**
* @see
org.jbehave.core.io.LoadFromClasspath#loadStoryAsText(java.lang.String)
*/
@Override
public String loadStoryAsText(String storyPath) {
List<String> findPaths = new
StoryFinder().findPaths(codeLocationFromClass(this.getClass()), storyPath, "");
if (findPaths.size() == 0) {
throw new RuntimeException("Pfad nicht gefunden: " +
storyPath);
} else {
storyPath = findPaths.get(0);
}
return super.loadStoryAsText(storyPath);
}
}
{code}
And use this class in my storyrunner. This works fine for me.
GivenStories: **/spec/MeineGeschichte.story
-> now works
But i think i doing something wrong? I think it ought to work without my
workaround...
best regards
Sven Schäfer
Sry for my bad english... ;(
--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email