Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Drop back to older smallcheck

  • Loading branch information...
commit 072fb92ac56954087f27003b6b5d9ca5683698ed 1 parent 86db097
@mightybyte mightybyte authored
View
1  src/Snap/Snaplet.hs
@@ -64,6 +64,7 @@ module Snap.Snaplet
, getSnapletDescription
, getSnapletUserConfig
, getSnapletRootURL
+ , snapletURL
, getRoutePattern
, setRoutePattern
View
9 src/Snap/Snaplet/Internal/Types.hs
@@ -222,6 +222,15 @@ getSnapletRootURL = liftM getRootURL getOpaqueConfig
------------------------------------------------------------------------------
+-- | Constructs a url relative to the current snaplet.
+snapletURL :: (Monad (m b v), MonadSnaplet m)
+ => ByteString -> m b v ByteString
+snapletURL suffix = do
+ cfg <- getOpaqueConfig
+ return $ buildPath (B.dropWhile (=='/') suffix : _scRouteContext cfg)
+
+
+------------------------------------------------------------------------------
-- | Snaplet infrastructure is available during runtime request processing
-- through the Handler monad. There aren't very many standalone functions to
-- read about here, but this is deceptive. The key is in the type class
View
8 test/snap-testsuite.cabal
@@ -18,11 +18,11 @@ Executable snap-testsuite
http-conduit >= 1.7 && < 1.9,
http-types >= 0.6 && < 0.9,
process == 1.*,
- smallcheck >= 1.0 && < 1.1,
+ smallcheck >= 0.6 && < 0.7,
test-framework >= 0.6 && < 0.7,
test-framework-hunit >= 0.2.7 && < 0.3,
test-framework-quickcheck2 >= 0.2.12.1 && < 0.3,
- test-framework-smallcheck >= 0.2 && < 0.3,
+ test-framework-smallcheck >= 0.1 && < 0.2,
unix >= 2.2.0.0 && < 2.7,
MonadCatchIO-transformers >= 0.2 && < 0.4,
@@ -171,11 +171,11 @@ Executable nesttest
http-conduit >= 1.7 && < 1.9,
http-types >= 0.6 && < 0.9,
process == 1.*,
- smallcheck >= 1.0 && < 1.1,
+ smallcheck >= 0.6 && < 0.7,
test-framework >= 0.6 && < 0.7,
test-framework-hunit >= 0.2.7 && < 0.3,
test-framework-quickcheck2 >= 0.2.12.1 && < 0.3,
- test-framework-smallcheck >= 0.2 && < 0.3,
+ test-framework-smallcheck >= 0.1 && < 0.2,
unix >= 2.2.0.0 && < 2.7,
MonadCatchIO-transformers >= 0.2 && < 0.4,
View
2  test/suite/Snap/Snaplet/Internal/Tests.hs
@@ -126,7 +126,7 @@ tests = testGroup "Snap.Snaplet.Internal"
, testProperty "buildPath generates no double slashes" doubleSlashes
]
-doubleSlashes :: Monad m => [String] -> Property m
+--doubleSlashes :: Monad m => [String] -> Property m
doubleSlashes arrStr = noSlashes ==> not (B.isInfixOf "//" $ buildPath arr)
where
arr = map B.pack arrStr
Please sign in to comment.
Something went wrong with that request. Please try again.