Permalink
Browse files

Drop back to older smallcheck

  • Loading branch information...
mightybyte committed Mar 7, 2013
1 parent 86db097 commit 072fb92ac56954087f27003b6b5d9ca5683698ed
View
@@ -64,6 +64,7 @@ module Snap.Snaplet
, getSnapletDescription
, getSnapletUserConfig
, getSnapletRootURL
+ , snapletURL
, getRoutePattern
, setRoutePattern
@@ -221,6 +221,15 @@ getSnapletRootURL :: (Monad (m b v), MonadSnaplet m) => m b v ByteString
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
@@ -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,
@@ -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

0 comments on commit 072fb92

Please sign in to comment.