@@ -9,7 +9,7 @@
99module Servant.JSSpec where
1010
1111import Data.Either (isRight)
12−import Data.Monoid ((<>), mconcat)
12+import Data.Monoid ((<>))
1313import Data.Proxy
1414import Data.Text (Text)
1515import qualified Data.Text as T
@@ -85,8 +85,10 @@ spec = describe "Servant.JQuery" $ do
8585 axiosSpec
8686 --angularSpec AngularCustom
8787
88−
88+shouldContain :: Text -> Text -> Expectation
8989a `shouldContain` b = shouldSatisfy a (T.isInfixOf b)
90+
91+shouldNotContain :: Text -> Text -> Expectation
9092a `shouldNotContain` b = shouldNotSatisfy a (T.isInfixOf b)
9193
9294axiosSpec :: Spec
@@ -135,9 +137,9 @@ angularSpec test = describe specLabel $ do
135137 ngOpts = NG.defAngularOptions { NG.serviceName = testName }
136138 genJS req = NG.angularService ngOpts req
137139
138−parseFromText = parse program ""
139140generateJSSpec :: TestNames -> (AjaxReq -> Text) -> Spec
140141generateJSSpec n gen = describe specLabel $ do
142+ let parseFromText = parse program ""
141143 it "should generate valid javascript" $ do
142144 let s = jsForAPI (Proxy :: Proxy TestAPI) (mconcat . map gen)
143145 parseFromText s `shouldSatisfy` isRight