1.1.5 测试特性 - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith
Version: null
1.1.5 测试特性
New Unit Testing Console Output
Test output from the test-app command has been improved:
新的单元测试输出结果
运行test-app命令的输出结果已经提升为如下图所示:
New Unit Testing API
There is a new unit testing API based on mixins that supports JUnit 3, 4 and Spock style tests (with Spock 0.6 and above). Example:import grails.test.mixin.TestFor@TestFor(SimpleController) class SimpleControllerTests { void testIndex() { controller.home() assert view == "/simple/homePage" assert model.title == "Hello World" } }
新的单元测试API
新的单元测试API现在支持JUnit 3, 4和Spock风格(Spock 0.6以上)的测试了,比如:import grails.test.mixin.TestFor@TestFor(SimpleController) class SimpleControllerTests { void testIndex() { controller.home() assert view == "/simple/homePage" assert model.title == "Hello World" } }

