git.iko.soy/typeable/mandrill
on master help sign in
Basic test scaffolding
f187414Alfredo Di Napoli
.travis.yml+3−2
@@ -24,11 +24,12 @@ before_install:
24
24
25install:
25install:
26 - cabal update
26 - cabal update
27− - cabal install --only-dependencies
27+ - cabal install --only-dependencies --enable-tests
28
28
29script:
29script:
30− - cabal configure -v2
30+ - cabal configure --enable-tests -v2
31 - cabal build
31 - cabal build
32+ - cabal test
32 - cabal check
33 - cabal check
33 - cabal sdist
34 - cabal sdist
34
35
mandrill.cabal+26−2
@@ -1,6 +1,7 @@
1name: mandrill
1name: mandrill
2version: 0.1.0.0
2version: 0.1.0.0
3synopsis: Library for interfacing with the Mandrill JSON API
3synopsis: Library for interfacing with the Mandrill JSON API
4+description: Pure Haskell client for the Mandrill JSON API
4license: MIT
5license: MIT
5license-file: LICENSE
6license-file: LICENSE
6author: Alfredo Di Napoli
7author: Alfredo Di Napoli
@@ -9,6 +10,10 @@ category: Network
9build-type: Simple
10build-type: Simple
10cabal-version: >=1.10
11cabal-version: >=1.10
11
12
13+source-repository head
14+ type: git
15+ location: https://github.com/adinapoli/mandrill
16+
12library
17library
13 exposed-modules:
18 exposed-modules:
14 Network.API.Mandrill.Settings
19 Network.API.Mandrill.Settings
@@ -18,7 +23,7 @@ library
18 Network.API.Mandrill.HTTP
23 Network.API.Mandrill.HTTP
19 other-modules:
24 other-modules:
20 Network.API.Mandrill.Utils
25 Network.API.Mandrill.Utils
21− -- other-extensions:
26+ -- other-extensions:
22 build-depends:
27 build-depends:
23 base >=4.6 && < 5
28 base >=4.6 && < 5
24 , text >= 1.0.0.0 && < 1.2
29 , text >= 1.0.0.0 && < 1.2
@@ -30,4 +35,23 @@ library
30 hs-source-dirs:
35 hs-source-dirs:
31 src
36 src
32 default-language:
37 default-language:
33− Haskell2010
38+ Haskell2010
39+
40+test-suite mandrill-tests
41+ type:
42+ exitcode-stdio-1.0
43+ main-is:
44+ Main.hs
45+ other-modules:
46+ Tests
47+ hs-source-dirs:
48+ test
49+ default-language:
50+ Haskell2010
51+ build-depends:
52+ mandrill -any
53+ , base
54+ , QuickCheck >= 2.6 && < 2.8
55+ , tasty >= 0.7 && < 0.9
56+ , tasty-quickcheck
57+ , tasty-hunit
test/Main.hsnew file+19
@@ -0,0 +1,19 @@
1+
2+module Main where
3+
4+import Tests
5+import Test.Tasty
6+import Test.Tasty.HUnit
7+import Test.Tasty.QuickCheck
8+
9+----------------------------------------------------------------------
10+withQuickCheckDepth :: TestName -> Int -> [TestTree] -> TestTree
11+withQuickCheckDepth tn depth tests =
12+ localOption (QuickCheckTests depth) (testGroup tn tests)
13+
14+----------------------------------------------------------------------
15+main :: IO ()
16+main = defaultMainWithIngredients defaultIngredients $
17+ testGroup "Mandrill tests" [
18+ testCase "messages/send.json API parsing" testMessagesSend
19+ ]
test/Tests.hsnew file+9
@@ -0,0 +1,9 @@
1+
2+module Tests where
3+
4+import Test.QuickCheck
5+import Test.Tasty.HUnit
6+
7+
8+testMessagesSend :: Assertion
9+testMessagesSend = return ()