3
我創建了一個新的grails應用程序,它帶有一個空的控制器,它呈現「hello」。Grails 2.4.3單元測試的數量不正確
然後,我創建了一堆的單元測試只是驗證它打招呼,基本上是這樣×4:
void "test something"() {
when:
controller.index()
then:
response.text == "hello"
}
然而,在我的輸出,它似乎認爲有2次試驗,至少最初:
Running 2 unit tests...
Running 2 unit tests... 1 of 2
Running 2 unit tests... 2 of 2
Running 2 unit tests... 3 of 3
Running 2 unit tests... 4 of 4
Completed 4 unit tests, 0 failed in 0m 5s
怎麼了?
我注意到這個在2.2中可以正常工作,然後當我們升級到2.3時就崩潰了。當它說「運行2個單元測試」時,我認爲「2」是測試類的數量。但是,當測試正在執行時,它實際上增加了已經運行的測試方法的數量。雖然對我們來說這只是一個小小的噱頭... – rcgeorge23 2014-10-22 07:32:44