git.iko.soy/typeable/mandrill
on master help sign in
Basic test scaffolding
commitf187414255fbc045bc71fae32c04f4f7572297f4 authorAlfredo Di Napoli <alfredo.dinapoli@gmail.com> dateSun 17 Aug 2014, 15:57 (12 years ago) parentcece0a5
4 files changed+57−4
.travis.yml+3−2 mandrill.cabal+26−2 test/Main.hs+19 test/Tests.hs+9
.travis.yml+3−2
@@ -24,11 +24,12 @@ before_install:
2424
2525install:
2626 - cabal update
27− - cabal install --only-dependencies
27+ - cabal install --only-dependencies --enable-tests
2828
2929script:
30− - cabal configure -v2
30+ - cabal configure --enable-tests -v2
3131 - cabal build
32+ - cabal test
3233 - cabal check
3334 - cabal sdist
3435
mandrill.cabal+26−2
@@ -1,6 +1,7 @@
11name: mandrill
22version: 0.1.0.0
33synopsis: Library for interfacing with the Mandrill JSON API
4+description: Pure Haskell client for the Mandrill JSON API
45license: MIT
56license-file: LICENSE
67author: Alfredo Di Napoli
@@ -9,6 +10,10 @@ category: Network
910build-type: Simple
1011cabal-version: >=1.10
1112
13+source-repository head
14+ type: git
15+ location: https://github.com/adinapoli/mandrill
16+
1217library
1318 exposed-modules:
1419 Network.API.Mandrill.Settings
@@ -18,7 +23,7 @@ library
1823 Network.API.Mandrill.HTTP
1924 other-modules:
2025 Network.API.Mandrill.Utils
21− -- other-extensions:
26+ -- other-extensions:
2227 build-depends:
2328 base >=4.6 && < 5
2429 , text >= 1.0.0.0 && < 1.2
@@ -30,4 +35,23 @@ library
3035 hs-source-dirs:
3136 src
3237 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 ()