[dancer-users] Test application failed

WK wanradt at gmail.com
Tue Dec 9 07:47:43 GMT 2014


Tere!

2014-12-08 11:12 GMT+02:00 Brilliantov Kirill Vladimirovich
<brilliantov at byterg.ru>:

>
>         response_headers_are_deeply [GET => $i], ['Content-Type' => 'text/xml'];

...
>
> #   Failed test 'headers are as expected for GET /rest/node'
> #   at t/002_rest_node_route.t line 20.
> #     Structures begin differing at:
> #          $got->[2] = 'Server'
> #     $expected->[2] = Does not exist


I never used *_deeply tests neither in Test::More or Dancer::Test, but
I see contradiction in docs. Test::More says about is_deeply:

"it does a deep comparison walking each data structure to see if they
are equivalent. If the two structures are different, it will display
the place where they start differing."

Dancer::Test says about response_headers_are_deeply (uses is_deeply internally):

"Asserts that the response headers data structure equals the one given"

According to Test::More, your test should fail, because your expected
data differs from what you got as response.

-- 
Wbr,
Kõike hääd,

Gunnar


More information about the dancer-users mailing list