packages feed

pusher-http-haskell 1.1.0.3 → 1.1.0.4

raw patch · 3 files changed

+14/−12 lines, 3 filesdep ~QuickCheckdep ~aesonPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: QuickCheck, aeson

API changes (from Hackage documentation)

Files

pusher-http-haskell.cabal view
@@ -1,5 +1,5 @@ name:                 pusher-http-haskell-version:              1.1.0.3+version:              1.1.0.4 cabal-version:        >=1.18 build-type:           Simple license:              MIT@@ -30,7 +30,7 @@   default-language:   Haskell2010   hs-source-dirs:     src   default-extensions: OverloadedStrings-  build-depends:      aeson >=0.8 && <1.1,+  build-depends:      aeson >=0.8 && <1.2,                       base >=4.7 && <4.10,                       bytestring ==0.10.*,                       base16-bytestring ==0.1.*,@@ -38,7 +38,6 @@                       hashable ==1.2.*,                       http-client >=0.4 && <0.6,                       http-types >=0.8 && <0.10,-                      QuickCheck >=2.7 && <2.10,                       text ==1.2.*,                       time >=1.4 && <1.7,                       transformers >=0.3 && <0.6,
src/Network/Pusher/Data.hs view
@@ -45,7 +45,6 @@ import Data.Text.Encoding (encodeUtf8) import GHC.Generics (Generic) import Network.HTTP.Client (Manager, defaultManagerSettings, newManager)-import Test.QuickCheck (Arbitrary, arbitrary, elements) import qualified Data.Aeson as A import qualified Data.ByteString as B import qualified Data.Text as T@@ -115,9 +114,6 @@  instance Hashable ChannelType -instance Arbitrary ChannelType where-  arbitrary = elements [Public, Private, Presence]- renderChannelPrefix :: ChannelType -> T.Text renderChannelPrefix Public = "" renderChannelPrefix Private = "private-"@@ -130,9 +126,6 @@   } deriving (Eq, Generic, Show)  instance Hashable Channel--instance Arbitrary Channel where-  arbitrary = Channel <$> arbitrary <*> (T.pack <$> arbitrary)  renderChannel :: Channel -> T.Text renderChannel (Channel cType cName) = renderChannelPrefix cType <> cName
test/Protocol.hs view
@@ -1,9 +1,10 @@ module Protocol where  import Test.Hspec (Spec, describe, it, shouldBe)-import Test.QuickCheck (property)+import Test.QuickCheck (Arbitrary(..), elements, property) import qualified Data.Aeson as A import qualified Data.HashMap.Strict as HM+import qualified Data.Text as T  import Network.Pusher   ( Channel(..)@@ -19,6 +20,15 @@   , Users(..)   ) +newtype TestChannel = TestChannel Channel deriving (Show)++instance Arbitrary TestChannel where+  arbitrary = do+    let+      testChannelType = elements [Public, Private, Presence]+      channel = Channel <$> testChannelType <*> (T.pack <$> arbitrary)+    TestChannel <$> channel+ test :: Spec test = do   describe "Protocol.Channel" $ do@@ -29,7 +39,7 @@       renderChannel (Channel Private "test") `shouldBe` "private-test"      it "show instance is an inverse of parseChannel" $-      property $ \chan -> parseChannel (renderChannel chan) == chan+      property $ \(TestChannel chan) -> parseChannel (renderChannel chan) == chan    describe "Protocol.ChannelsInfo" $     it "parsing works" $