rakuten 0.1.0.5 → 0.1.0.6
raw patch · 6 files changed
+33/−29 lines, 6 filesdep ~extensibledep ~http-typesdep ~servant-serverPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: extensible, http-types, servant-server
API changes (from Hackage documentation)
Files
- rakuten.cabal +7/−7
- src/Rakuten/Types/Base.hs +4/−5
- src/Rakuten/Types/Ichiba.hs +3/−4
- test/Rakuten/Endpoints/IchibaSpec.hs +4/−9
- test/Rakuten/Test/MockServer.hs +2/−3
- test/Spec.hs +13/−1
rakuten.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: ec9bf50bef20da14e70977ce1cf85d3bd1fd7520181acba51f8731d0c8ed7c34+-- hash: 4c66e879fbf9d4b953c523b0a460bbd3f5515f159b02f3c6e08848c33a205fad name: rakuten-version: 0.1.0.5+version: 0.1.0.6 synopsis: The Rakuten API in Haskell description: See README at <https://github.com/matsubara0507/rakuten#readme> category: Web@@ -34,11 +34,11 @@ , connection >=0.2.7 && <0.3 , constraints >=0.9.1 && <0.11 , data-default-class >=0.1.2.0 && <0.2- , extensible >=0.4.1 && <0.5+ , extensible >=0.4.1 && <0.4.7.2 , http-api-data >=0.3.5 && <0.3.8 , http-client >=0.5.5.0 && <0.6 , http-client-tls >=0.3.3.1 && <0.4- , http-types >=0.9.1 && <0.12+ , http-types >=0.9.1 && <0.13 , lens >=4.15.3 && <5.0 , req >=0.3.0 && <1.1.0 , text >=1.2.2.1 && <1.3@@ -71,15 +71,15 @@ , connection >=0.2.7 && <0.3 , constraints >=0.9.1 && <0.11 , data-default-class >=0.1.2.0 && <0.2- , extensible >=0.4.1 && <0.5+ , extensible >=0.4.1 && <0.4.7.2 , hspec >=2.4.1 && <2.5 , http-api-data >=0.3.5 && <0.3.8 , http-client >=0.5.5.0 && <0.6 , http-client-tls >=0.3.3.1 && <0.4- , http-types >=0.9.1 && <0.12+ , http-types >=0.9.1 && <0.13 , lens >=4.15.3 && <5.0 , req >=0.3.0 && <1.1.0- , servant-server >=0.9.1.1 && <0.13+ , servant-server >=0.9.1.1 && <0.14 , text >=1.2.2.1 && <1.3 , unordered-containers >=0.2.8 && <0.3 , warp >=3.2.11 && <3.3
src/Rakuten/Types/Base.hs view
@@ -1,7 +1,6 @@-{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE TypeOperators #-} module Rakuten.Types.Base ( ImageUrl @@ -10,4 +9,4 @@ import Data.Extensible import Data.Text (Text) -type ImageUrl = Record '[ "imageUrl" ':> Text ] +type ImageUrl = Record '[ "imageUrl" ':> Text ]
src/Rakuten/Types/Ichiba.hs view
@@ -1,7 +1,6 @@-{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE TypeOperators #-} module Rakuten.Types.Ichiba ( -- Response JSON Type
test/Rakuten/Endpoints/IchibaSpec.hs view
@@ -1,6 +1,5 @@ module Rakuten.Endpoints.IchibaSpec - ( main - , spec + ( spec ) where import Data.Default.Class (Default (def)) @@ -8,15 +7,11 @@ import Rakuten.Endpoints.Ichiba (searchIchibaGenre, searchIchibaItem) import Rakuten.Test.Class (TestData (..)) import Rakuten.Test.Client (TestClient (..)) -import Rakuten.Test.MockServer (runMockServer) -import Test.Hspec (Spec, around_, context, describe, - hspec, it, shouldBe) - -main :: IO () -main = hspec spec +import Test.Hspec (Spec, context, describe, it, + shouldBe) spec :: Spec -spec = around_ runMockServer $ do +spec = do describe "searchIchibaItem: endpoint GET /IchibaItem/Search/20170706" $ do context "correct responce" $ do it "should return IchibaItems response body" $ do
test/Rakuten/Test/MockServer.hs view
@@ -11,7 +11,6 @@ ) where import Control.Concurrent -import Control.Exception import Network.Wai.Handler.Warp import Rakuten.Test.Class import Rakuten.Types @@ -37,5 +36,5 @@ runMockServer :: IO () -> IO () runMockServer action = do - tid <- forkIO mockServer - action `finally` killThread tid + _ <- forkIO mockServer + action
test/Spec.hs view
@@ -1,1 +1,13 @@-{-# OPTIONS_GHC -F -pgmF hspec-discover #-} +module Main where + +import Test.Hspec + +import qualified Rakuten.Endpoints.IchibaSpec +import Rakuten.Test.MockServer (runMockServer) + +main :: IO () +main = hspec spec + +spec :: Spec +spec = around_ runMockServer $ do + describe "Rakuten.Endpoints.Ichiba" Rakuten.Endpoints.IchibaSpec.spec