purescript-httpurple/test/Test/HTTPure/StatusSpec.purs
Petri Lehtinen 8badd62b3e PureScript 0.12 support (#89)
- Upgrade all dependencies
- Use Effect instead of Eff
- Use Foreign.Object instead of StrMap
- Use Effect.Ref instead of Control.Monad.ST
- Drop SecureServerM, it's the same as ServerM now
2018-07-08 16:16:48 -07:00

25 lines
602 B
Haskell

module Test.HTTPure.StatusSpec where
import Prelude
import Effect.Class as EffectClass
import Test.Spec as Spec
import HTTPure.Status as Status
import Test.HTTPure.TestHelpers as TestHelpers
import Test.HTTPure.TestHelpers ((?=))
writeSpec :: TestHelpers.Test
writeSpec = Spec.describe "write" do
Spec.it "writes the given status code" do
status <- EffectClass.liftEffect do
mock <- TestHelpers.mockResponse
Status.write mock 123
pure $ TestHelpers.getResponseStatus mock
status ?= 123
statusSpec :: TestHelpers.Test
statusSpec = Spec.describe "Status" do
writeSpec