未通过的Gavel / Dredd测试失败

时间:2015-06-09 19:04:28

标签: testing automated-tests dredd

任何人都可以帮我弄清楚为什么这个Dredd测试会失败?它看起来很好:

fail: GET /device/2/battery duration: 260ms
fail: body: Real and expected data does not match.

request: 
body: 

headers: 
    User-Agent: Dredd/0.6.0 (Darwin 14.3.0; x64)

uri: /device/2/battery
method: GET


expected: 
headers: 
    connection: Keep-Alive
    content-length: 18
    content-type: text/plain

body: 
BATTERY REQ QUEUED

statusCode: 200


actual: 
statusCode: 200
headers: 
    connection: Keep-Alive
    content-length: 18
    content-type: text/plain
    date: Tue, 09 Jun 2015 19:01:59 GMT

body: 
BATTERY REQ QUEUED

1 个答案:

答案 0 :(得分:3)

这些可疑错误通常是由预期或真实身体中的追踪换行符引起的。尝试使用CLI API Blueprint parser解析您的蓝图,看看Dredd的确切期望。

a hint for a workaround for this in the documentation