git.iko.soy/typeable/servant
on master help sign in
servant-foreign: add test for camelCase
aa2b56dMatt Bray
servant-foreign/servant-foreign.cabal+13
@@ -33,3 +33,16 @@ library
33 hs-source-dirs: src
33 hs-source-dirs: src
34 default-language: Haskell2010
34 default-language: Haskell2010
35 ghc-options: -Wall
35 ghc-options: -Wall
36+
37+
38+test-suite spec
39+ type: exitcode-stdio-1.0
40+ hs-source-dirs: test
41+ ghc-options: -Wall
42+ main-is: Spec.hs
43+ other-modules:
44+ Servant.ForeignSpec
45+ build-depends: base
46+ , hspec >= 2.1.8
47+ , servant-foreign
48+ default-language: Haskell2010
servant-foreign/test/Servant/ForeignSpec.hsnew file+17
@@ -0,0 +1,17 @@
1+{-# LANGUAGE OverloadedStrings #-}
2+
3+module Servant.ForeignSpec where
4+
5+import Servant.Foreign (camelCase)
6+
7+import Test.Hspec
8+
9+spec :: Spec
10+spec = describe "Servant.Foreign" $ do
11+ camelCaseSpec
12+
13+camelCaseSpec :: Spec
14+camelCaseSpec = describe "camelCase" $ do
15+ it "converts FunctionNames to camelCase" $ do
16+ camelCase ["post", "counter", "inc"] `shouldBe` "postCounterInc"
17+ camelCase ["get", "hyphen-ated", "counter"] `shouldBe` "getHyphenatedCounter"
servant-foreign/test/Spec.hsnew file+1
@@ -0,0 +1 @@
1+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}