hspec-setup 0.2.0.0 → 0.2.1.0
raw patch · 3 files changed
+19/−14 lines, 3 filesdep +strictPVP ok
version bump matches the API change (PVP)
Dependencies added: strict
API changes (from Hackage documentation)
Files
- hspec-setup.cabal +4/−1
- src/Test/Hspec/Setup.hs +7/−4
- test/Test/Hspec/SetupSpec.hs +8/−9
hspec-setup.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: hspec-setup-version: 0.2.0.0+version: 0.2.1.0 synopsis: Add an hspec test-suite in one command description: @hspec-setup@ is a command-line tool for adding an hspec test-suite with minimal work. See the@@ -40,6 +40,7 @@ , projectroot >=0.2 , haskell-src-exts >=1.18.2 && <1.19 , split+ , strict exposed-modules: Test.Hspec.Setup System.Directory.Recursive@@ -60,6 +61,7 @@ , projectroot >=0.2 , haskell-src-exts >=1.18.2 && <1.19 , split+ , strict , hspec-setup hs-source-dirs: bin@@ -79,6 +81,7 @@ , projectroot >=0.2 , haskell-src-exts >=1.18.2 && <1.19 , split+ , strict , QuickCheck , language-dockerfile >=0.3.4 , base
src/Test/Hspec/Setup.hs view
@@ -1,7 +1,9 @@-{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE LambdaCase #-} module Test.Hspec.Setup where +import Prelude hiding (readFile)+ import Control.Monad import Data.List import Data.List.Split@@ -14,7 +16,8 @@ import System.Environment import System.Exit import System.FilePath-import System.IO+import System.IO hiding (readFile)+import System.IO.Strict (readFile) import System.Process main :: IO ()@@ -145,7 +148,7 @@ where decToDescribe decName = [ " describe \"" <> decName <> "\" $ do"- , " it \"works\" pending"+ , " it \"works\" pending\n" ] hspecGenerate pr Nothing = error "Interactive mode not implemented" @@ -185,7 +188,7 @@ mi = elemIndex "tests:" hpackLines case mi of Nothing -> do- when ("hspec" `isInfixOf` hpackContents) $ do+ when ("hspec:" `isInfixOf` hpackContents) $ do hPutStrLn stderr "File already has test-suite. Exiting..." exitFailure appendFile (pr </> fp) hspecHpackTestSuite
test/Test/Hspec/SetupSpec.hs view
@@ -71,28 +71,26 @@ withImage :: EDockerfileM () -> (String -> IO b) -> IO b withImage img action = do- {-callCommand $ unwords [ "docker images |"-}- {-, "grep hspec-setup-tests-autogen |"-}- {-, "awk '{print $3}' |"-}- {-, "tail -n +3 |"-}- {-, "xargs docker rmi -f"-}- {-]-} bracket (dockerBuild img) (const (return ()))- -- (\imgTag -> callCommand ("docker rmi -f " <> imgTag)) action spec :: Spec spec = do describe "given an empty cabal project" $- it "works" $ do+ it "works" pending+ {-+ $ do let img = newProjectImage >> cmd "hspec-setup" withImage img $ \tag -> dockerRun tag+ -} describe "given an empty hpack project" $- it "works" $ do+ it "works" pending+ {-+ $ do let img = newProjectImage >> do run "stack install hpack-convert" run "hpack-convert"@@ -103,3 +101,4 @@ cmd "cat package.yaml | grep 'tests:'" withImage img $ \tag -> dockerRun tag+ -}