Merge remote-tracking branch 'origin/master' into HEAD

This commit is contained in:
Michael Snoyman 2012-11-02 08:06:49 +02:00
commit befdd91d58
28 changed files with 76 additions and 75 deletions

@ -1 +1 @@
Subproject commit e1128e3eacb21cb4a59c00f30abf536c8ba66893
Subproject commit 9902ff808afbcb417c6ad125941343878e3afe11

View File

@ -1,5 +1,5 @@
name: yesod-auth
version: 1.1.1.2
version: 1.1.1.4
license: MIT
license-file: LICENSE
author: Michael Snoyman, Patrick Brisbin
@ -34,7 +34,7 @@ library
, persistent >= 1.0 && < 1.1
, persistent-template >= 1.0 && < 1.1
, SHA >= 1.4.1.3 && < 1.6
, http-conduit >= 1.5 && < 1.7
, http-conduit >= 1.5 && < 1.9
, aeson >= 0.5
, pwstore-fast >= 2.2 && < 3
, lifted-base >= 0.1

View File

@ -4,7 +4,6 @@
module YesodCoreTest.Cache (cacheTest, Widget) where
import Test.Hspec
import Test.Hspec.HUnit()
import Network.Wai
import Network.Wai.Test

View File

@ -4,7 +4,6 @@
module YesodCoreTest.CleanPath (cleanPathTest, Widget) where
import Test.Hspec
import Test.Hspec.HUnit()
import Yesod.Core hiding (Request)

View File

@ -6,7 +6,6 @@ module YesodCoreTest.ErrorHandling
) where
import Yesod.Core
import Test.Hspec
import Test.Hspec.HUnit()
import Network.Wai
import Network.Wai.Test
import Text.Hamlet (hamlet)

View File

@ -4,7 +4,6 @@
module YesodCoreTest.Exceptions (exceptionsTest, Widget) where
import Test.Hspec
import Test.Hspec.HUnit ()
import Yesod.Core hiding (Request)
import Network.Wai

View File

@ -7,7 +7,6 @@ import YesodCoreTest.JsLoaderSites.HeadAsync (HA(..))
import YesodCoreTest.JsLoaderSites.Bottom (B(..))
import Test.Hspec
import Test.Hspec.HUnit ()
import Yesod.Core hiding (Request)
import Network.Wai.Test

View File

@ -4,7 +4,6 @@
module YesodCoreTest.Links (linksTest, Widget) where
import Test.Hspec
import Test.Hspec.HUnit ()
import Yesod.Core hiding (Request)
import Text.Hamlet

View File

@ -5,7 +5,6 @@
module YesodCoreTest.Media (mediaTest, Widget) where
import Test.Hspec
import Test.Hspec.HUnit ()
import Yesod.Core hiding (Request)
import Network.Wai
import Network.Wai.Test

View File

@ -3,7 +3,6 @@
module YesodCoreTest.NoOverloadedStrings (noOverloadedTest, Widget) where
import Test.Hspec
import Test.Hspec.HUnit ()
import Yesod.Core hiding (Request)
import Network.Wai.Test

View File

@ -4,7 +4,6 @@
module YesodCoreTest.Widget (widgetTest) where
import Test.Hspec
import Test.Hspec.HUnit ()
import Yesod.Core hiding (Request)
import Text.Julius

View File

@ -13,7 +13,6 @@ import Yesod.Core hiding (Request)
import Network.Wai.Test
import Network.Wai
import Test.Hspec
import Test.Hspec.HUnit()
yesod :: (YesodDispatch y y, Yesod y) => y -> Session a -> IO a
yesod app f = toWaiApp app >>= runSession f

View File

@ -1,5 +1,5 @@
name: yesod-core
version: 1.1.3
version: 1.1.3.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>

View File

@ -327,17 +327,17 @@ selectFieldList = selectField . optionsPairs
selectField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a
selectField = selectFieldHelper
(\theId name inside -> [whamlet|
(\theId name attrs inside -> [whamlet|
$newline never
<select ##{theId} name=#{name}>^{inside}
<select ##{theId} name=#{name} *{attrs}>^{inside}
|]) -- outside
(\_theId _name isSel -> [whamlet|
$newline never
<option value=none :isSel:selected>_{MsgSelectNone}
|]) -- onOpt
(\_theId _name attrs value isSel text -> [whamlet|
(\_theId _name _attrs value isSel text -> [whamlet|
$newline never
<option value=#{value} :isSel:selected *{attrs}>#{text}
<option value=#{value} :isSel:selected>#{text}
|]) -- inside
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 = selectFieldHelper
(\theId _name inside -> [whamlet|
(\theId _name _attrs inside -> [whamlet|
$newline never
<div ##{theId}>^{inside}
|])
@ -494,7 +494,7 @@ optionsPersist filts ords toDisplay = fmap mkOptionList $ do
selectFieldHelper
:: (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 -> [(Text, Text)] -> Text -> Bool -> Text -> GWidget sub master ())
-> GHandler sub master (OptionList a) -> Field sub master a
@ -504,7 +504,7 @@ selectFieldHelper outside onOpt inside opts' = Field
return $ selectParser opts x
, fieldView = \theId name attrs val isReq -> do
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
flip mapM_ opts $ \opt -> inside
theId

View File

@ -1,7 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
import Test.HUnit
import Test.Hspec.Monadic
import Test.Hspec.HUnit ()
import Test.Hspec
import Data.Time (TimeOfDay (TimeOfDay))
import Data.Text (pack)
@ -10,7 +8,7 @@ import Yesod.Form.Types
main :: IO ()
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)
, ("1:00", Right $ TimeOfDay 1 0 0)
, ("1:00 AM", Right $ TimeOfDay 1 0 0)

View File

@ -64,7 +64,6 @@ test-suite test
, yesod-form
, time
, hspec
, HUnit
, text
source-repository head

View File

@ -1,5 +1,5 @@
name: yesod-platform
version: 1.1.3
version: 1.1.4.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@ -32,7 +32,7 @@ library
, cereal == 0.3.5.2
, certificate == 1.2.8
, clientsession == 0.8.0.1
, conduit == 0.5.2.4
, conduit == 0.5.2.7
, cookie == 0.4.0.1
, cprng-aes == 0.2.4
, cpu == 0.1.1
@ -49,36 +49,36 @@ library
, entropy == 0.2.1
, failure == 0.2.0.1
, fast-logger == 0.3.1
, file-embed == 0.0.4.5
, file-embed == 0.0.4.6
, filesystem-conduit == 0.5.0.1
, hamlet == 1.1.1
, hashable == 1.1.2.5
, hjsmin == 0.1.2
, hspec == 1.3.0
, hjsmin == 0.1.3
, hspec == 1.3.0.1
, hspec-expectations == 0.3.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-types == 0.7.3.0.1
, language-javascript == 0.5.4
, language-javascript == 0.5.6
, largeword == 1.0.3
, lifted-base == 0.1.2
, lifted-base == 0.2
, mime-mail == 0.4.1.2
, mime-types == 0.1.0.0
, monad-control == 0.3.1.4
, monad-logger == 0.2.1
, network-conduit == 0.5.0.2
, network-conduit == 0.6.1.1
, path-pieces == 0.1.2
, pem == 0.1.1
, persistent == 1.0.1.2
, persistent == 1.0.1.3
, persistent-template == 1.0.0.2
, pool-conduit == 0.1.0.3
, primitive == 0.4.1
, primitive == 0.5.0.1
, pureMD5 == 2.1.2.1
, pwstore-fast == 2.3
, ranges == 0.2.4
, resource-pool == 0.2.1.1
, resourcet == 0.4.0.1
, resourcet == 0.4.0.2
, safe == 0.3.3
, semigroups == 0.8.4.1
, shakespeare == 1.0.1.4
@ -87,44 +87,44 @@ library
, shakespeare-js == 1.0.0.6
, shakespeare-text == 1.0.0.5
, silently == 1.2.0.2
, simple-sendfile == 0.2.7
, simple-sendfile == 0.2.8
, skein == 0.1.0.9
, socks == 0.4.2
, stringsearch == 0.3.6.3
, stringsearch == 0.3.6.4
, system-fileio == 0.3.10
, system-filepath == 0.4.7
, tagged == 0.4.4
, tagsoup == 0.12.8
, tagstream-conduit == 0.5.3
, tar == 0.4.0.0
, tar == 0.4.0.1
, tls == 0.9.11
, tls-extra == 0.4.6
, tls-extra == 0.4.7
, transformers-base == 0.4.1
, unix-compat == 0.3.0.2
, unix-compat == 0.4.0.0
, unordered-containers == 0.2.2.1
, utf8-light == 0.4.0.1
, utf8-string == 0.3.7
, vault == 0.2.0.1
, vector == 0.9.1
, vector == 0.10.0.1
, void == 0.5.8
, wai == 1.3.0.1
, 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-test == 1.3.0
, warp == 1.3.2
, warp == 1.3.4.1
, xml-conduit == 1.0.3.1
, xml-types == 0.3.3
, xss-sanitize == 0.3.2
, yaml == 0.8.0.2
, yesod == 1.1.1
, yesod-auth == 1.1.1.1
, yesod-core == 1.1.2
, yesod-default == 1.1.0
, yaml == 0.8.1
, yesod == 1.1.2
, yesod-auth == 1.1.1.2
, yesod-core == 1.1.3.1
, yesod-default == 1.1.0.2
, yesod-form == 1.1.3
, yesod-json == 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-test == 0.3.0.1
, zlib-bindings == 0.1.1.1

View File

@ -14,8 +14,7 @@ module Hierarchy
, toText
) where
import Test.Hspec.Monadic
import Test.Hspec.HUnit ()
import Test.Hspec
import Test.HUnit
import Yesod.Routes.Parse
import Yesod.Routes.TH
@ -92,7 +91,7 @@ getTableR _ t = append "TableR " t
instance RunHandler Hierarchy master where
runHandler h _ _ subRoute toMaster = (h, fmap toMaster subRoute)
hierarchy :: Specs
hierarchy :: Spec
hierarchy = describe "hierarchy" $ do
it "renders root correctly" $
renderRoute (AdminR 5 AdminRootR) @?= (["admin", "5"], [])

View File

@ -8,8 +8,7 @@
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE CPP #-}
import Test.Hspec.Monadic
import Test.Hspec.HUnit ()
import Test.Hspec
import Test.HUnit ((@?=))
import Data.Text (Text, pack, unpack, singleton)
import Yesod.Routes.Dispatch hiding (Static, Dynamic)
@ -195,7 +194,7 @@ thDispatchAlias master sub toMaster app404 handler405 method0 pieces0 =
-}
main :: IO ()
main = hspecX $ do
main = hspec $ do
describe "justRoot" $ do
it "dispatches correctly" $ test justRoot [] @?= Just 1
it "fails correctly" $ test justRoot ["foo"] @?= Nothing

View File

@ -144,10 +144,6 @@ instance RenderRoute Static where
renderRoute (StaticRoute x y) = (x, y)
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 =
staticApp set req { pathInfo = textPieces }

View File

@ -1,8 +1,6 @@
module YesodStaticTest (specs) where
import Test.Hspec
import Test.HUnit ( (@?=) )
import Test.Hspec.HUnit ( )
import Yesod.Static (getFileListPieces)
@ -10,5 +8,4 @@ specs :: Spec
specs = do
describe "get file list" $ do
it "pieces" $ do
x <- getFileListPieces "test/fs"
x @?= [["foo"], ["bar", "baz"]]
getFileListPieces "test/fs" `shouldReturn` [["foo"], ["bar", "baz"]]

View File

@ -14,6 +14,10 @@ description: Static file serving subsite for Yesod Web Framework.
extra-source-files:
test/YesodStaticTest.hs
test/tests.hs
test/fs/bar/baz
test/fs/tmp/ignored
test/fs/.ignored
test/fs/foo
library
build-depends: base >= 4 && < 5
@ -46,7 +50,6 @@ test-suite tests
cpp-options: -DTEST_EXPORT
build-depends: base
, hspec >= 1.3 && < 1.4
, HUnit
-- copy from above
, containers
, old-time

View File

@ -65,8 +65,22 @@ module Yesod.Test (
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.Runner as Runner
import qualified Data.List as DL
import qualified Data.Maybe as DY
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.ByteString.Lazy.Char8 as BSL8
import qualified Test.HUnit as HUnit
import qualified Test.Hspec.HUnit ()
import qualified Network.HTTP.Types as H
import qualified Network.Socket.Internal as Sock
import Data.CaseInsensitive (CI)
@ -143,7 +156,7 @@ type CookieValue = ByteString
runTests :: Application -> Pool conn -> SpecsConn conn -> IO ()
runTests app connection specsDef = do
(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'
-- and 'ConnectionPool'

View File

@ -1,8 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
import Test.HUnit hiding (Test)
import Test.Hspec.Monadic
import Test.Hspec.HUnit ()
import Test.Hspec
import Yesod.Test.CssQuery
import Yesod.Test.TransversingCSS

View File

@ -151,6 +151,7 @@ scaffold = do
writeFile' "config/keter.yaml" $(codegen "config/keter.yaml")
writeFile' "app/main.hs" $(codegen "app/main.hs")
writeFile' "devel.hs" $(codegen "devel.hs")
writeFile' ".gitignore" $(codegen ".gitignore")
writeFile' (project ++ ".cabal") $(codegen "project.cabal")
writeFile' ".ghci" $(codegen ".ghci")

View File

@ -0,0 +1,6 @@
dist/
static/tmp/
config/client_session_key.aes
*.hi
*.o
*.sqlite3

View File

@ -59,7 +59,7 @@ library
, yesod-form >= 1.1 && < 1.2
, yesod-test >= 0.3 && < 0.4
, clientsession >= 0.8 && < 0.9
, bytestring >= 0.9 && < 0.10
, bytestring >= 0.9 && < 0.11
, text >= 0.11 && < 0.12
, persistent >= 1.0 && < 1.1
, persistent-~backendLower~ >= 1.0 && < 1.1
@ -73,7 +73,7 @@ library
, wai-extra >= 1.3 && < 1.4
, yaml >= 0.8 && < 0.9
, http-conduit >= 1.5 && < 1.7
, directory >= 1.1 && < 1.2
, directory >= 1.1 && < 1.3
, warp >= 1.3 && < 1.4
, data-default

View File

@ -1,5 +1,5 @@
name: yesod
version: 1.1.1.2
version: 1.1.2
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@ -62,6 +62,7 @@ extra-source-files:
scaffold/config/robots.txt.cg
scaffold/config/mongoDB.yml.cg
scaffold/devel.hs.cg
scaffold/.gitignore.cg
library
build-depends: base >= 4.3 && < 5