2013-07-16 18 views
1

當我執行在JBehave如下:JBehave - 示例表執行意見

When I GET '<foo>' ACCEPT '<bar>' 
Then I expect status <someStatus> 
Then I expect response body <someBody> 
Examples: 
|foo|bar|someStatus|someBody| 
|blah|blah|blah|blah| 


!-- DELETE 

看來,「舉例:」需要在評論 - 作爲表的一部分,因此(DELETE!)給我無效的字符錯誤。

Example: {foo=!-- DELETE, bar=, someStatus=, someBody=} 
When I GET '!-- DELETE' ACCEPT '' (FAILED) 
(java.lang.IllegalArgumentException: Illegal character... 

如果我刪除了註釋,測試運行時沒有錯誤。

我想保留表後的意見,我會怎麼做呢?

回答

0

呀,好像表中的解析器JBehave錯誤我。

在我們的案例中有這樣的事情引起了同樣的問題:

|foo |bar |someStatus|someBody| 
|blah|blah|blah  |blah | 

!-- Scenario: commented out stuff 
!-- Meta: 
!-- @commentedMeta stuff 
!-- etc. 

由於Karloss建議,這是足夠使用的|--代替!--第一個評論,以使表工作corretly,即:

|foo |bar |someStatus|someBody| 
|blah|blah|blah  |blah | 
|-- Scenario: commented out stuff <== Note the change here in the first char! 
!-- Meta: 
!-- @commentedMeta stuff 
!-- etc.