12

我想问一下grails(即data.xml)中测试文件的最佳位置在哪里。它是 test/ 文件夹吗?

如何在集成测试中轻松加载测试文件?

谢谢,马特奥

4

1 回答 1

13

在测试/集成/资源中

然后,即如果您使用 spock 进行测试,您可以执行以下操作:

def mediaBundlerService = Mock(MediaBundlerService)
mediaBundlerService.getPath(_) >> [path: new File('test/integration/resources/test-bundle/').absolutePath + "/"]   
于 2012-05-24T15:53:26.787 回答