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