Skip to content

Instantly share code, notes, and snippets.

@k-bx

k-bx/errors Secret

Created June 25, 2013 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k-bx/f7feb6222a2febe62b7c to your computer and use it in GitHub Desktop.
Save k-bx/f7feb6222a2febe62b7c to your computer and use it in GitHub Desktop.
strange errors in haskell
tests/EntitiesTest.hs:16:9:
No instance for (Yesod.Core.Handler.RedirectUrl
site0 (yesod-routes-1.2.0.1:Yesod.Routes.Class.Route App))
arising from a use of `get'
Possible fix:
add an instance declaration for
(Yesod.Core.Handler.RedirectUrl
site0 (yesod-routes-1.2.0.1:Yesod.Routes.Class.Route App))
In a stmt of a 'do' block: get EntriesR
In the second argument of `($)', namely
`do { get EntriesR;
statusIs 200;
maybeResponse <- getResponse;
let response = fromJust maybeResponse;
.... }'
In a stmt of a 'do' block:
yit "gets empty list of entries"
$ do { get EntriesR;
statusIs 200;
maybeResponse <- getResponse;
let response = fromJust maybeResponse;
.... }
tests/EntitiesTest.hs:22:53:
Couldn't match expected type `Maybe [EntryPresentation]'
with actual type `[a0]'
In the third argument of `assertEqual', namely `[]'
In a stmt of a 'do' block:
assertEqual "decoded list is empty" decoded []
In the second argument of `($)', namely
`do { get EntriesR;
statusIs 200;
maybeResponse <- getResponse;
let response = fromJust maybeResponse;
.... }'
entitiesSpecs :: Spec
entitiesSpecs =
ydescribe "/entries/ API tests" $ do
yit "gets empty list of entries" $ do
get EntriesR
statusIs 200
maybeResponse <- getResponse
let response = fromJust maybeResponse
let body = simpleBody response
let decoded = decode body :: Maybe [EntryPresentation]
assertEqual "decoded list is empty" (fromJust decoded) []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment