Ste*_*all 7 groovy junit jbehave
我正在尝试创建并运行一个简单的JUnitStory来运行.story文件.
我有这个:
class Scenario1 extends JUnitStory {
@Delegate MySteps steps = new MySteps()
@Override
public Configuration configuration() {
return new MostUsefulConfiguration()
.useStoryLoader(new LoadFromRelativeFile(new File('src/test/groovy').toURL()))
.useStoryReporterBuilder(
new StoryReporterBuilder()
.withDefaultFormats()
.withFormats(Format.HTML, Format.CONSOLE, Format.TXT)
);
}
@Override
public List candidateSteps() {
final candidateSteps = new InstanceStepsFactory(configuration(), this).createCandidateSteps()
return candidateSteps;
}
}
Run Code Online (Sandbox Code Playgroud)
有或没有委托(在MySteps的所有注释方法中复制和粘贴),每当我运行JBehave时,我得到以下输出:
somePattern(){
// PENDING
}
Run Code Online (Sandbox Code Playgroud)
这就像个别故事没有采取步骤.
当我创建"Stories"类并将所有故事文件拉入时storyPaths,将定义各个步骤.使用调试器,我看到candidateSteps正在被击中,但它并没有拉动它需要的数据.
这可能会发生什么?
| 归档时间: |
|
| 查看次数: |
4501 次 |
| 最近记录: |