curl-runnings 0.11.0 → 0.11.1
raw patch · 5 files changed
+21/−13 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +13/−6
- curl-runnings.cabal +3/−3
- src/Testing/CurlRunnings/Internal/Parser.hs +3/−3
- src/Testing/CurlRunnings/Types.hs +1/−1
- test/Spec.hs +1/−0
README.md view
@@ -1,6 +1,8 @@ # curl-runnings -[](https://travis-ci.org/aviaviavi/curl-runnings) [](https://hackage.haskell.org/package/curl-runnings)+[](https://travis-ci.org/aviaviavi/curl-runnings) +[](https://hackage.haskell.org/package/curl-runnings)+[](https://scarf.sh/package/avi/curl-runnings) _Feel the rhythm! Feel the rhyme! Get on up, it's testing time! curl-runnings!_ @@ -37,12 +39,17 @@ ### Installing -There are few options to install:+The best way to install curl-runnings is with the [scarf](https://scarf.sh)+package manager. -- download the Linux or Mac built releases from the- github [releases page](https://github.com/aviaviavi/curl-runnings/releases)-- install the binary with `stack` or `cabal`-- build from source with `stack`+```bash+# If you don't have scarf, you can easily install it with:+$ curl -L https://scarf.sh/install | bash+ +$ scarf install curl-runnings+```++Alternatively, you can compile from source with stack. ### Writing a test specification
curl-runnings.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.1.+-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack ----- hash: b7f43a448b7bffd8bc3340f6483fb99f6391934bc869150ced8021708ca83864+-- hash: c5eff7acb49843acbacdcf64e3e57fd05242eee41e466f2468cc9bf696b5f666 name: curl-runnings-version: 0.11.0+version: 0.11.1 synopsis: A framework for declaratively writing curl based API tests description: Please see the README on Github at <https://github.com/aviaviavi/curl-runnings#readme> category: Testing
src/Testing/CurlRunnings/Internal/Parser.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE OverloadedStrings #-} -- | Internal module for parsing string based directives inside of curl runnings -- suites. Use this module at your own risk, it may change. Currently, string@@ -48,7 +48,7 @@ let trimmed = T.strip q in case Text.Megaparsec.parse parseFullTextWithQuery "" trimmed of Right a -> Right a >>= validateQuery- Left a -> Left $ QueryParseError (T.pack $ errorBundlePretty a) q+ Left a -> Left $ QueryParseError (T.pack $ errorBundlePretty a) q -- | Once we have parsed a query successfully, ensure that it is a legal query validateQuery :: [InterpolatedQuery] -> Either QueryError [InterpolatedQuery]@@ -121,7 +121,7 @@ notFollowedBy endingChars (lexeme . try) ((KeyIndex . T.pack) <$> p) where- p = (:) <$> letterChar <*> many (noneOf ['.', '[', ']', '<', '>', ' ', '{', '}'])+ p = (:) <$> (letterChar <|> (char '_')) <*> many (noneOf ['.', '[', ']', '<', '>', ' ', '{', '}']) jsonIndexParser :: Parser Query jsonIndexParser =
src/Testing/CurlRunnings/Types.hs view
@@ -361,7 +361,7 @@ T.unpack $ makeRed "[FAIL] " <> name c <> "\n" <>- mconcat (map ((\s -> "\nAssertion failed: " <> s) . (<> "\n") . pShow) failures)+ mconcat (map ((\s -> "\nAssertion failed: " <> s) . (<> "\n") . (T.pack . show)) failures) -- | A wrapper type around a set of test cases. This is the top level spec type -- that we parse a test spec file into
test/Spec.hs view
@@ -27,6 +27,7 @@ parseQuery "just some text" `shouldSatisfy` isRight parseQuery "$<RESPONSES[0].key.key>" `shouldSatisfy` isRight parseQuery "$<RESPONSES[0].key.key[0].key_with_underscores>" `shouldSatisfy` isRight+ parseQuery "$<RESPONSES[0].key.key[0]._key_starts_with_underscores>" `shouldSatisfy` isRight parseQuery "$<RESPONSES[100].key.key[0].key_with_underscores>" `shouldSatisfy` isRight parseQuery "some text before $<RESPONSES[100].key.key[0].key_with_underscores> and after" `shouldSatisfy` isRight parseQuery "some $<RESPONSES[100]> querires $<RESPONSES[100]>" `shouldSatisfy` isRight