Merge remote-tracking branch 'origin/master' into HEAD
This commit is contained in:
commit
befdd91d58
2
scripts
2
scripts
@ -1 +1 @@
|
|||||||
Subproject commit e1128e3eacb21cb4a59c00f30abf536c8ba66893
|
Subproject commit 9902ff808afbcb417c6ad125941343878e3afe11
|
||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-auth
|
name: yesod-auth
|
||||||
version: 1.1.1.2
|
version: 1.1.1.4
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman, Patrick Brisbin
|
author: Michael Snoyman, Patrick Brisbin
|
||||||
@ -34,7 +34,7 @@ library
|
|||||||
, persistent >= 1.0 && < 1.1
|
, persistent >= 1.0 && < 1.1
|
||||||
, persistent-template >= 1.0 && < 1.1
|
, persistent-template >= 1.0 && < 1.1
|
||||||
, SHA >= 1.4.1.3 && < 1.6
|
, SHA >= 1.4.1.3 && < 1.6
|
||||||
, http-conduit >= 1.5 && < 1.7
|
, http-conduit >= 1.5 && < 1.9
|
||||||
, aeson >= 0.5
|
, aeson >= 0.5
|
||||||
, pwstore-fast >= 2.2 && < 3
|
, pwstore-fast >= 2.2 && < 3
|
||||||
, lifted-base >= 0.1
|
, lifted-base >= 0.1
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
module YesodCoreTest.Cache (cacheTest, Widget) where
|
module YesodCoreTest.Cache (cacheTest, Widget) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit()
|
|
||||||
|
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Network.Wai.Test
|
import Network.Wai.Test
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
module YesodCoreTest.CleanPath (cleanPathTest, Widget) where
|
module YesodCoreTest.CleanPath (cleanPathTest, Widget) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit()
|
|
||||||
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@ module YesodCoreTest.ErrorHandling
|
|||||||
) where
|
) where
|
||||||
import Yesod.Core
|
import Yesod.Core
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit()
|
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Network.Wai.Test
|
import Network.Wai.Test
|
||||||
import Text.Hamlet (hamlet)
|
import Text.Hamlet (hamlet)
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
module YesodCoreTest.Exceptions (exceptionsTest, Widget) where
|
module YesodCoreTest.Exceptions (exceptionsTest, Widget) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import YesodCoreTest.JsLoaderSites.HeadAsync (HA(..))
|
|||||||
import YesodCoreTest.JsLoaderSites.Bottom (B(..))
|
import YesodCoreTest.JsLoaderSites.Bottom (B(..))
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
import Network.Wai.Test
|
import Network.Wai.Test
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
module YesodCoreTest.Links (linksTest, Widget) where
|
module YesodCoreTest.Links (linksTest, Widget) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
import Text.Hamlet
|
import Text.Hamlet
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
module YesodCoreTest.Media (mediaTest, Widget) where
|
module YesodCoreTest.Media (mediaTest, Widget) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Network.Wai.Test
|
import Network.Wai.Test
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
module YesodCoreTest.NoOverloadedStrings (noOverloadedTest, Widget) where
|
module YesodCoreTest.NoOverloadedStrings (noOverloadedTest, Widget) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
import Network.Wai.Test
|
import Network.Wai.Test
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
module YesodCoreTest.Widget (widgetTest) where
|
module YesodCoreTest.Widget (widgetTest) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
|
|
||||||
import Yesod.Core hiding (Request)
|
import Yesod.Core hiding (Request)
|
||||||
import Text.Julius
|
import Text.Julius
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Yesod.Core hiding (Request)
|
|||||||
import Network.Wai.Test
|
import Network.Wai.Test
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit()
|
|
||||||
|
|
||||||
yesod :: (YesodDispatch y y, Yesod y) => y -> Session a -> IO a
|
yesod :: (YesodDispatch y y, Yesod y) => y -> Session a -> IO a
|
||||||
yesod app f = toWaiApp app >>= runSession f
|
yesod app f = toWaiApp app >>= runSession f
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-core
|
name: yesod-core
|
||||||
version: 1.1.3
|
version: 1.1.3.1
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
@ -327,17 +327,17 @@ selectFieldList = selectField . optionsPairs
|
|||||||
|
|
||||||
selectField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a
|
selectField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a
|
||||||
selectField = selectFieldHelper
|
selectField = selectFieldHelper
|
||||||
(\theId name inside -> [whamlet|
|
(\theId name attrs inside -> [whamlet|
|
||||||
$newline never
|
$newline never
|
||||||
<select ##{theId} name=#{name}>^{inside}
|
<select ##{theId} name=#{name} *{attrs}>^{inside}
|
||||||
|]) -- outside
|
|]) -- outside
|
||||||
(\_theId _name isSel -> [whamlet|
|
(\_theId _name isSel -> [whamlet|
|
||||||
$newline never
|
$newline never
|
||||||
<option value=none :isSel:selected>_{MsgSelectNone}
|
<option value=none :isSel:selected>_{MsgSelectNone}
|
||||||
|]) -- onOpt
|
|]) -- onOpt
|
||||||
(\_theId _name attrs value isSel text -> [whamlet|
|
(\_theId _name _attrs value isSel text -> [whamlet|
|
||||||
$newline never
|
$newline never
|
||||||
<option value=#{value} :isSel:selected *{attrs}>#{text}
|
<option value=#{value} :isSel:selected>#{text}
|
||||||
|]) -- inside
|
|]) -- inside
|
||||||
|
|
||||||
multiSelectFieldList :: (Eq a, RenderMessage master FormMessage, RenderMessage master msg) => [(msg, a)] -> Field sub master [a]
|
multiSelectFieldList :: (Eq a, RenderMessage master FormMessage, RenderMessage master msg) => [(msg, a)] -> Field sub master [a]
|
||||||
@ -374,7 +374,7 @@ radioFieldList = radioField . optionsPairs
|
|||||||
|
|
||||||
radioField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a
|
radioField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a
|
||||||
radioField = selectFieldHelper
|
radioField = selectFieldHelper
|
||||||
(\theId _name inside -> [whamlet|
|
(\theId _name _attrs inside -> [whamlet|
|
||||||
$newline never
|
$newline never
|
||||||
<div ##{theId}>^{inside}
|
<div ##{theId}>^{inside}
|
||||||
|])
|
|])
|
||||||
@ -494,7 +494,7 @@ optionsPersist filts ords toDisplay = fmap mkOptionList $ do
|
|||||||
|
|
||||||
selectFieldHelper
|
selectFieldHelper
|
||||||
:: (Eq a, RenderMessage master FormMessage)
|
:: (Eq a, RenderMessage master FormMessage)
|
||||||
=> (Text -> Text -> GWidget sub master () -> GWidget sub master ())
|
=> (Text -> Text -> [(Text, Text)] -> GWidget sub master () -> GWidget sub master ())
|
||||||
-> (Text -> Text -> Bool -> GWidget sub master ())
|
-> (Text -> Text -> Bool -> GWidget sub master ())
|
||||||
-> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> GWidget sub master ())
|
-> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> GWidget sub master ())
|
||||||
-> GHandler sub master (OptionList a) -> Field sub master a
|
-> GHandler sub master (OptionList a) -> Field sub master a
|
||||||
@ -504,7 +504,7 @@ selectFieldHelper outside onOpt inside opts' = Field
|
|||||||
return $ selectParser opts x
|
return $ selectParser opts x
|
||||||
, fieldView = \theId name attrs val isReq -> do
|
, fieldView = \theId name attrs val isReq -> do
|
||||||
opts <- fmap olOptions $ lift opts'
|
opts <- fmap olOptions $ lift opts'
|
||||||
outside theId name $ do
|
outside theId name attrs $ do
|
||||||
unless isReq $ onOpt theId name $ not $ render opts val `elem` map optionExternalValue opts
|
unless isReq $ onOpt theId name $ not $ render opts val `elem` map optionExternalValue opts
|
||||||
flip mapM_ opts $ \opt -> inside
|
flip mapM_ opts $ \opt -> inside
|
||||||
theId
|
theId
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
import Test.HUnit
|
import Test.Hspec
|
||||||
import Test.Hspec.Monadic
|
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
import Data.Time (TimeOfDay (TimeOfDay))
|
import Data.Time (TimeOfDay (TimeOfDay))
|
||||||
import Data.Text (pack)
|
import Data.Text (pack)
|
||||||
|
|
||||||
@ -10,7 +8,7 @@ import Yesod.Form.Types
|
|||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hspec $
|
main = hspec $
|
||||||
describe "parseTime" $ mapM_ (\(s, e) -> it s $ parseTime (pack s) @?= e)
|
describe "parseTime" $ mapM_ (\(s, e) -> it s $ parseTime (pack s) `shouldBe` e)
|
||||||
[ ("01:00:00", Right $ TimeOfDay 1 0 0)
|
[ ("01:00:00", Right $ TimeOfDay 1 0 0)
|
||||||
, ("1:00", Right $ TimeOfDay 1 0 0)
|
, ("1:00", Right $ TimeOfDay 1 0 0)
|
||||||
, ("1:00 AM", Right $ TimeOfDay 1 0 0)
|
, ("1:00 AM", Right $ TimeOfDay 1 0 0)
|
||||||
|
|||||||
@ -64,7 +64,6 @@ test-suite test
|
|||||||
, yesod-form
|
, yesod-form
|
||||||
, time
|
, time
|
||||||
, hspec
|
, hspec
|
||||||
, HUnit
|
|
||||||
, text
|
, text
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-platform
|
name: yesod-platform
|
||||||
version: 1.1.3
|
version: 1.1.4.1
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -32,7 +32,7 @@ library
|
|||||||
, cereal == 0.3.5.2
|
, cereal == 0.3.5.2
|
||||||
, certificate == 1.2.8
|
, certificate == 1.2.8
|
||||||
, clientsession == 0.8.0.1
|
, clientsession == 0.8.0.1
|
||||||
, conduit == 0.5.2.4
|
, conduit == 0.5.2.7
|
||||||
, cookie == 0.4.0.1
|
, cookie == 0.4.0.1
|
||||||
, cprng-aes == 0.2.4
|
, cprng-aes == 0.2.4
|
||||||
, cpu == 0.1.1
|
, cpu == 0.1.1
|
||||||
@ -49,36 +49,36 @@ library
|
|||||||
, entropy == 0.2.1
|
, entropy == 0.2.1
|
||||||
, failure == 0.2.0.1
|
, failure == 0.2.0.1
|
||||||
, fast-logger == 0.3.1
|
, fast-logger == 0.3.1
|
||||||
, file-embed == 0.0.4.5
|
, file-embed == 0.0.4.6
|
||||||
, filesystem-conduit == 0.5.0.1
|
, filesystem-conduit == 0.5.0.1
|
||||||
, hamlet == 1.1.1
|
, hamlet == 1.1.1
|
||||||
, hashable == 1.1.2.5
|
, hashable == 1.1.2.5
|
||||||
, hjsmin == 0.1.2
|
, hjsmin == 0.1.3
|
||||||
, hspec == 1.3.0
|
, hspec == 1.3.0.1
|
||||||
, hspec-expectations == 0.3.0.2
|
, hspec-expectations == 0.3.0.2
|
||||||
, html-conduit == 0.1.0.2
|
, html-conduit == 0.1.0.2
|
||||||
, http-conduit == 1.6.1
|
, http-conduit == 1.6.1.2
|
||||||
, http-date == 0.0.2
|
, http-date == 0.0.2
|
||||||
, http-types == 0.7.3.0.1
|
, http-types == 0.7.3.0.1
|
||||||
, language-javascript == 0.5.4
|
, language-javascript == 0.5.6
|
||||||
, largeword == 1.0.3
|
, largeword == 1.0.3
|
||||||
, lifted-base == 0.1.2
|
, lifted-base == 0.2
|
||||||
, mime-mail == 0.4.1.2
|
, mime-mail == 0.4.1.2
|
||||||
, mime-types == 0.1.0.0
|
, mime-types == 0.1.0.0
|
||||||
, monad-control == 0.3.1.4
|
, monad-control == 0.3.1.4
|
||||||
, monad-logger == 0.2.1
|
, monad-logger == 0.2.1
|
||||||
, network-conduit == 0.5.0.2
|
, network-conduit == 0.6.1.1
|
||||||
, path-pieces == 0.1.2
|
, path-pieces == 0.1.2
|
||||||
, pem == 0.1.1
|
, pem == 0.1.1
|
||||||
, persistent == 1.0.1.2
|
, persistent == 1.0.1.3
|
||||||
, persistent-template == 1.0.0.2
|
, persistent-template == 1.0.0.2
|
||||||
, pool-conduit == 0.1.0.3
|
, pool-conduit == 0.1.0.3
|
||||||
, primitive == 0.4.1
|
, primitive == 0.5.0.1
|
||||||
, pureMD5 == 2.1.2.1
|
, pureMD5 == 2.1.2.1
|
||||||
, pwstore-fast == 2.3
|
, pwstore-fast == 2.3
|
||||||
, ranges == 0.2.4
|
, ranges == 0.2.4
|
||||||
, resource-pool == 0.2.1.1
|
, resource-pool == 0.2.1.1
|
||||||
, resourcet == 0.4.0.1
|
, resourcet == 0.4.0.2
|
||||||
, safe == 0.3.3
|
, safe == 0.3.3
|
||||||
, semigroups == 0.8.4.1
|
, semigroups == 0.8.4.1
|
||||||
, shakespeare == 1.0.1.4
|
, shakespeare == 1.0.1.4
|
||||||
@ -87,44 +87,44 @@ library
|
|||||||
, shakespeare-js == 1.0.0.6
|
, shakespeare-js == 1.0.0.6
|
||||||
, shakespeare-text == 1.0.0.5
|
, shakespeare-text == 1.0.0.5
|
||||||
, silently == 1.2.0.2
|
, silently == 1.2.0.2
|
||||||
, simple-sendfile == 0.2.7
|
, simple-sendfile == 0.2.8
|
||||||
, skein == 0.1.0.9
|
, skein == 0.1.0.9
|
||||||
, socks == 0.4.2
|
, socks == 0.4.2
|
||||||
, stringsearch == 0.3.6.3
|
, stringsearch == 0.3.6.4
|
||||||
, system-fileio == 0.3.10
|
, system-fileio == 0.3.10
|
||||||
, system-filepath == 0.4.7
|
, system-filepath == 0.4.7
|
||||||
, tagged == 0.4.4
|
, tagged == 0.4.4
|
||||||
, tagsoup == 0.12.8
|
, tagsoup == 0.12.8
|
||||||
, tagstream-conduit == 0.5.3
|
, tagstream-conduit == 0.5.3
|
||||||
, tar == 0.4.0.0
|
, tar == 0.4.0.1
|
||||||
, tls == 0.9.11
|
, tls == 0.9.11
|
||||||
, tls-extra == 0.4.6
|
, tls-extra == 0.4.7
|
||||||
, transformers-base == 0.4.1
|
, transformers-base == 0.4.1
|
||||||
, unix-compat == 0.3.0.2
|
, unix-compat == 0.4.0.0
|
||||||
, unordered-containers == 0.2.2.1
|
, unordered-containers == 0.2.2.1
|
||||||
, utf8-light == 0.4.0.1
|
, utf8-light == 0.4.0.1
|
||||||
, utf8-string == 0.3.7
|
, utf8-string == 0.3.7
|
||||||
, vault == 0.2.0.1
|
, vault == 0.2.0.1
|
||||||
, vector == 0.9.1
|
, vector == 0.10.0.1
|
||||||
, void == 0.5.8
|
, void == 0.5.8
|
||||||
, wai == 1.3.0.1
|
, wai == 1.3.0.1
|
||||||
, wai-app-static == 1.3.0.2
|
, wai-app-static == 1.3.0.2
|
||||||
, wai-extra == 1.3.0.2
|
, wai-extra == 1.3.0.3
|
||||||
, wai-logger == 0.3.0
|
, wai-logger == 0.3.0
|
||||||
, wai-test == 1.3.0
|
, wai-test == 1.3.0
|
||||||
, warp == 1.3.2
|
, warp == 1.3.4.1
|
||||||
, xml-conduit == 1.0.3.1
|
, xml-conduit == 1.0.3.1
|
||||||
, xml-types == 0.3.3
|
, xml-types == 0.3.3
|
||||||
, xss-sanitize == 0.3.2
|
, xss-sanitize == 0.3.2
|
||||||
, yaml == 0.8.0.2
|
, yaml == 0.8.1
|
||||||
, yesod == 1.1.1
|
, yesod == 1.1.2
|
||||||
, yesod-auth == 1.1.1.1
|
, yesod-auth == 1.1.1.2
|
||||||
, yesod-core == 1.1.2
|
, yesod-core == 1.1.3.1
|
||||||
, yesod-default == 1.1.0
|
, yesod-default == 1.1.0.2
|
||||||
, yesod-form == 1.1.3
|
, yesod-form == 1.1.3
|
||||||
, yesod-json == 1.1.0
|
, yesod-json == 1.1.0
|
||||||
, yesod-persistent == 1.1.0
|
, yesod-persistent == 1.1.0
|
||||||
, yesod-routes == 1.1.0
|
, yesod-routes == 1.1.0.2
|
||||||
, yesod-static == 1.1.0.1
|
, yesod-static == 1.1.0.1
|
||||||
, yesod-test == 0.3.0.1
|
, yesod-test == 0.3.0.1
|
||||||
, zlib-bindings == 0.1.1.1
|
, zlib-bindings == 0.1.1.1
|
||||||
|
|||||||
@ -14,8 +14,7 @@ module Hierarchy
|
|||||||
, toText
|
, toText
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Test.Hspec.Monadic
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
import Test.HUnit
|
import Test.HUnit
|
||||||
import Yesod.Routes.Parse
|
import Yesod.Routes.Parse
|
||||||
import Yesod.Routes.TH
|
import Yesod.Routes.TH
|
||||||
@ -92,7 +91,7 @@ getTableR _ t = append "TableR " t
|
|||||||
instance RunHandler Hierarchy master where
|
instance RunHandler Hierarchy master where
|
||||||
runHandler h _ _ subRoute toMaster = (h, fmap toMaster subRoute)
|
runHandler h _ _ subRoute toMaster = (h, fmap toMaster subRoute)
|
||||||
|
|
||||||
hierarchy :: Specs
|
hierarchy :: Spec
|
||||||
hierarchy = describe "hierarchy" $ do
|
hierarchy = describe "hierarchy" $ do
|
||||||
it "renders root correctly" $
|
it "renders root correctly" $
|
||||||
renderRoute (AdminR 5 AdminRootR) @?= (["admin", "5"], [])
|
renderRoute (AdminR 5 AdminRootR) @?= (["admin", "5"], [])
|
||||||
|
|||||||
@ -8,8 +8,7 @@
|
|||||||
{-# LANGUAGE TypeSynonymInstances #-}
|
{-# LANGUAGE TypeSynonymInstances #-}
|
||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
import Test.Hspec.Monadic
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
import Test.HUnit ((@?=))
|
import Test.HUnit ((@?=))
|
||||||
import Data.Text (Text, pack, unpack, singleton)
|
import Data.Text (Text, pack, unpack, singleton)
|
||||||
import Yesod.Routes.Dispatch hiding (Static, Dynamic)
|
import Yesod.Routes.Dispatch hiding (Static, Dynamic)
|
||||||
@ -195,7 +194,7 @@ thDispatchAlias master sub toMaster app404 handler405 method0 pieces0 =
|
|||||||
-}
|
-}
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hspecX $ do
|
main = hspec $ do
|
||||||
describe "justRoot" $ do
|
describe "justRoot" $ do
|
||||||
it "dispatches correctly" $ test justRoot [] @?= Just 1
|
it "dispatches correctly" $ test justRoot [] @?= Just 1
|
||||||
it "fails correctly" $ test justRoot ["foo"] @?= Nothing
|
it "fails correctly" $ test justRoot ["foo"] @?= Nothing
|
||||||
|
|||||||
@ -144,10 +144,6 @@ instance RenderRoute Static where
|
|||||||
renderRoute (StaticRoute x y) = (x, y)
|
renderRoute (StaticRoute x y) = (x, y)
|
||||||
|
|
||||||
instance Yesod master => YesodDispatch Static master where
|
instance Yesod master => YesodDispatch Static master where
|
||||||
-- Need to append trailing slash to make relative links work
|
|
||||||
yesodDispatch _ _ _ _ _ _ _ [] _ req =
|
|
||||||
return $ responseLBS status301 [("Location", rawPathInfo req `S.append` "/")] ""
|
|
||||||
|
|
||||||
yesodDispatch _ _ (Static set) _ _ _ _ textPieces _ req =
|
yesodDispatch _ _ (Static set) _ _ _ _ textPieces _ req =
|
||||||
staticApp set req { pathInfo = textPieces }
|
staticApp set req { pathInfo = textPieces }
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
module YesodStaticTest (specs) where
|
module YesodStaticTest (specs) where
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.HUnit ( (@?=) )
|
|
||||||
import Test.Hspec.HUnit ( )
|
|
||||||
|
|
||||||
import Yesod.Static (getFileListPieces)
|
import Yesod.Static (getFileListPieces)
|
||||||
|
|
||||||
@ -10,5 +8,4 @@ specs :: Spec
|
|||||||
specs = do
|
specs = do
|
||||||
describe "get file list" $ do
|
describe "get file list" $ do
|
||||||
it "pieces" $ do
|
it "pieces" $ do
|
||||||
x <- getFileListPieces "test/fs"
|
getFileListPieces "test/fs" `shouldReturn` [["foo"], ["bar", "baz"]]
|
||||||
x @?= [["foo"], ["bar", "baz"]]
|
|
||||||
|
|||||||
@ -14,6 +14,10 @@ description: Static file serving subsite for Yesod Web Framework.
|
|||||||
extra-source-files:
|
extra-source-files:
|
||||||
test/YesodStaticTest.hs
|
test/YesodStaticTest.hs
|
||||||
test/tests.hs
|
test/tests.hs
|
||||||
|
test/fs/bar/baz
|
||||||
|
test/fs/tmp/ignored
|
||||||
|
test/fs/.ignored
|
||||||
|
test/fs/foo
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
@ -46,7 +50,6 @@ test-suite tests
|
|||||||
cpp-options: -DTEST_EXPORT
|
cpp-options: -DTEST_EXPORT
|
||||||
build-depends: base
|
build-depends: base
|
||||||
, hspec >= 1.3 && < 1.4
|
, hspec >= 1.3 && < 1.4
|
||||||
, HUnit
|
|
||||||
-- copy from above
|
-- copy from above
|
||||||
, containers
|
, containers
|
||||||
, old-time
|
, old-time
|
||||||
|
|||||||
@ -65,8 +65,22 @@ module Yesod.Test (
|
|||||||
|
|
||||||
where
|
where
|
||||||
|
|
||||||
|
-- In in Hspec < 1.3 the Example instance for IO () (== Assertion/Expectation)
|
||||||
|
-- is orphan and only export from Test.Hspec.HUnit.
|
||||||
|
--
|
||||||
|
-- In Hspec 1.3.* it is still orphan, but re-exported from Test.Hspec.
|
||||||
|
--
|
||||||
|
-- Starting with Hspec 1.4.0 it is not orphan anymore.
|
||||||
|
--
|
||||||
|
-- As we only support Hspec >= 1.3, we import Test.Hspec to bring the orphan
|
||||||
|
-- instance into scope. This is better than importing Test.Hspec.HUnit, as
|
||||||
|
-- Test.Hspec.HUnit may be removed in the future.
|
||||||
|
--
|
||||||
|
-- As soon as we decide to drop support for Hspec 1.3.*, we can remove this
|
||||||
|
-- comment and the following import.
|
||||||
|
import qualified Test.Hspec ()
|
||||||
|
|
||||||
import qualified Test.Hspec.Core as Core
|
import qualified Test.Hspec.Core as Core
|
||||||
import qualified Test.Hspec.Runner as Runner
|
|
||||||
import qualified Data.List as DL
|
import qualified Data.List as DL
|
||||||
import qualified Data.Maybe as DY
|
import qualified Data.Maybe as DY
|
||||||
import qualified Data.ByteString.Char8 as BS8
|
import qualified Data.ByteString.Char8 as BS8
|
||||||
@ -75,7 +89,6 @@ import qualified Data.Text as T
|
|||||||
import qualified Data.Text.Encoding as TE
|
import qualified Data.Text.Encoding as TE
|
||||||
import qualified Data.ByteString.Lazy.Char8 as BSL8
|
import qualified Data.ByteString.Lazy.Char8 as BSL8
|
||||||
import qualified Test.HUnit as HUnit
|
import qualified Test.HUnit as HUnit
|
||||||
import qualified Test.Hspec.HUnit ()
|
|
||||||
import qualified Network.HTTP.Types as H
|
import qualified Network.HTTP.Types as H
|
||||||
import qualified Network.Socket.Internal as Sock
|
import qualified Network.Socket.Internal as Sock
|
||||||
import Data.CaseInsensitive (CI)
|
import Data.CaseInsensitive (CI)
|
||||||
@ -143,7 +156,7 @@ type CookieValue = ByteString
|
|||||||
runTests :: Application -> Pool conn -> SpecsConn conn -> IO ()
|
runTests :: Application -> Pool conn -> SpecsConn conn -> IO ()
|
||||||
runTests app connection specsDef = do
|
runTests app connection specsDef = do
|
||||||
(SpecsData _ _ specs) <- ST.execStateT specsDef (SpecsData app connection [])
|
(SpecsData _ _ specs) <- ST.execStateT specsDef (SpecsData app connection [])
|
||||||
Runner.hspec specs
|
Core.hspec specs
|
||||||
|
|
||||||
-- | Start describing a Tests suite keeping cookies and a reference to the tested 'Application'
|
-- | Start describing a Tests suite keeping cookies and a reference to the tested 'Application'
|
||||||
-- and 'ConnectionPool'
|
-- and 'ConnectionPool'
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
import Test.HUnit hiding (Test)
|
import Test.HUnit hiding (Test)
|
||||||
import Test.Hspec.Monadic
|
import Test.Hspec
|
||||||
import Test.Hspec.HUnit ()
|
|
||||||
|
|
||||||
import Yesod.Test.CssQuery
|
import Yesod.Test.CssQuery
|
||||||
import Yesod.Test.TransversingCSS
|
import Yesod.Test.TransversingCSS
|
||||||
|
|||||||
@ -151,6 +151,7 @@ scaffold = do
|
|||||||
writeFile' "config/keter.yaml" $(codegen "config/keter.yaml")
|
writeFile' "config/keter.yaml" $(codegen "config/keter.yaml")
|
||||||
writeFile' "app/main.hs" $(codegen "app/main.hs")
|
writeFile' "app/main.hs" $(codegen "app/main.hs")
|
||||||
writeFile' "devel.hs" $(codegen "devel.hs")
|
writeFile' "devel.hs" $(codegen "devel.hs")
|
||||||
|
writeFile' ".gitignore" $(codegen ".gitignore")
|
||||||
writeFile' (project ++ ".cabal") $(codegen "project.cabal")
|
writeFile' (project ++ ".cabal") $(codegen "project.cabal")
|
||||||
|
|
||||||
writeFile' ".ghci" $(codegen ".ghci")
|
writeFile' ".ghci" $(codegen ".ghci")
|
||||||
|
|||||||
6
yesod/scaffold/.gitignore.cg
Normal file
6
yesod/scaffold/.gitignore.cg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
dist/
|
||||||
|
static/tmp/
|
||||||
|
config/client_session_key.aes
|
||||||
|
*.hi
|
||||||
|
*.o
|
||||||
|
*.sqlite3
|
||||||
@ -59,7 +59,7 @@ library
|
|||||||
, yesod-form >= 1.1 && < 1.2
|
, yesod-form >= 1.1 && < 1.2
|
||||||
, yesod-test >= 0.3 && < 0.4
|
, yesod-test >= 0.3 && < 0.4
|
||||||
, clientsession >= 0.8 && < 0.9
|
, clientsession >= 0.8 && < 0.9
|
||||||
, bytestring >= 0.9 && < 0.10
|
, bytestring >= 0.9 && < 0.11
|
||||||
, text >= 0.11 && < 0.12
|
, text >= 0.11 && < 0.12
|
||||||
, persistent >= 1.0 && < 1.1
|
, persistent >= 1.0 && < 1.1
|
||||||
, persistent-~backendLower~ >= 1.0 && < 1.1
|
, persistent-~backendLower~ >= 1.0 && < 1.1
|
||||||
@ -73,7 +73,7 @@ library
|
|||||||
, wai-extra >= 1.3 && < 1.4
|
, wai-extra >= 1.3 && < 1.4
|
||||||
, yaml >= 0.8 && < 0.9
|
, yaml >= 0.8 && < 0.9
|
||||||
, http-conduit >= 1.5 && < 1.7
|
, http-conduit >= 1.5 && < 1.7
|
||||||
, directory >= 1.1 && < 1.2
|
, directory >= 1.1 && < 1.3
|
||||||
, warp >= 1.3 && < 1.4
|
, warp >= 1.3 && < 1.4
|
||||||
, data-default
|
, data-default
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod
|
name: yesod
|
||||||
version: 1.1.1.2
|
version: 1.1.2
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -62,6 +62,7 @@ extra-source-files:
|
|||||||
scaffold/config/robots.txt.cg
|
scaffold/config/robots.txt.cg
|
||||||
scaffold/config/mongoDB.yml.cg
|
scaffold/config/mongoDB.yml.cg
|
||||||
scaffold/devel.hs.cg
|
scaffold/devel.hs.cg
|
||||||
|
scaffold/.gitignore.cg
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4.3 && < 5
|
build-depends: base >= 4.3 && < 5
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user