Skip to content

Commit 8de7afe

Browse files
solfujimura
authored andcommitted
Add driver to each spec file, so that they can be run standalone in GHCi
1 parent 8c2c261 commit 8de7afe

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

test/FeatureSpec.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE ScopedTypeVariables #-}
22

3-
module FeatureSpec ( spec ) where
3+
module FeatureSpec ( main, spec ) where
44

55
import qualified Hi.Cli as Cli
66
import Hi.Directory (inDirectory)
@@ -23,6 +23,9 @@ import Test.Hspec
2323

2424
import Paths_hi (version)
2525

26+
main :: IO ()
27+
main = hspec spec
28+
2629
spec :: Spec
2730
spec = do
2831
describe "with command line options" $ do

test/Hi/GitSpec.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
module Hi.GitSpec ( spec ) where
1+
module Hi.GitSpec ( main, spec ) where
22

33
import Hi.Git
44

55
import Test.Hspec
66

7+
main :: IO ()
8+
main = hspec spec
9+
710
spec :: Spec
811
spec = do
912
let fullUrl = "[email protected]:fujimura/hi.git"

test/HiSpec.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE OverloadedStrings #-}
22

3-
module HiSpec ( spec ) where
3+
module HiSpec ( main, spec ) where
44

55
import Hi (process)
66
import Hi.Types
@@ -9,6 +9,9 @@ import Data.ByteString.Char8 (unpack)
99
import Data.Maybe (fromJust, isJust)
1010
import Test.Hspec
1111

12+
main :: IO ()
13+
main = hspec spec
14+
1215
options :: Option
1316
options = Option { initializeGitRepository = True
1417
, packageName = "testapp"

0 commit comments

Comments
 (0)