Style tweak

This commit is contained in:
Joe Nelson
2015-02-15 15:59:49 -08:00
parent 5cc77709ba
commit e37d5d9b25
7 changed files with 17 additions and 23 deletions
+2 -4
View File
@@ -17,8 +17,7 @@ executable postgrest
main-is: Main.hs
ghc-options: -Wall -W -O2
default-language: Haskell2010
default-extensions: OverloadedStrings, ScopedTypeVariables
other-extensions: QuasiQuotes
default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes
build-depends: base >=4.6 && <5
, hasql == 0.7.*, hasql-backend
, hasql-postgres == 0.10.*
@@ -57,8 +56,7 @@ executable postgrest
Test-Suite spec
Type: exitcode-stdio-1.0
Default-Language: Haskell2010
default-extensions: OverloadedStrings, ScopedTypeVariables
other-extensions: QuasiQuotes
default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes
Hs-Source-Dirs: test, src
ghc-options: -Wall -W -Werror
Main-Is: Main.hs
-1
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE QuasiQuotes #-}
module Feature.AuthSpec where
-- {{{ Imports
-1
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE QuasiQuotes #-}
module Feature.InsertSpec where
import Test.Hspec
+15 -13
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE QuasiQuotes, NoMonomorphismRestriction #-}
module Feature.QuerySpec where
import Test.Hspec
@@ -12,19 +11,22 @@ import Data.Text(Text)
import SpecHelper
testSet :: IO ()
testSet = do {
clearTable "items" >> clearTable "no_pk";
createItems 15;
pool :: H.Pool H.Postgres <- H.acquirePool pgSettings testPoolOpts;
testSet = do
clearTable "items" >> clearTable "no_pk"
createItems 15
pool <- H.acquirePool pgSettings testPoolOpts
void . liftIO $ H.session pool $ H.tx Nothing $ do
H.unitEx $
([H.stmt|insert into "1".no_pk (a, b) values (?,?), (?,?), (?,?), (?,?)|]
:: Text->Text->Text->Text->Text->Text->Text->Text-> H.Stmt H.Postgres)
"lick" "Fun"
"trick" "funky"
"barb" "foo"
"BARD" "FOOD"
}
mapM_ H.unitEx $ map (uncurry insertNoPk) [
("lick", "Fun")
, ("trick", "funky")
, ("barb", "foo")
, ("BARD", "FOOD")
]
where
insertNoPk :: Text -> Text -> H.Stmt H.Postgres
insertNoPk = [H.stmt|insert into "1".no_pk (a, b) values (?,?)|]
spec :: Spec
spec = beforeAll testSet . afterAll_ (clearTable "items") . around withApp $ do
describe "Querying a nonexistent table" $
-1
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Feature.StructureSpec where
import Test.Hspec hiding (pendingWith)
-1
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE QuasiQuotes #-}
module Main where
import Test.Hspec
-2
View File
@@ -1,5 +1,3 @@
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-}
module SpecHelper where
import Network.Wai