purescript-httpurple/test/Test/HTTPure/StatusSpec.purs

25 lines
631 B
Haskell
Raw Normal View History

2017-10-26 21:19:30 +00:00
module Test.HTTPure.StatusSpec where
import Prelude
import Effect.Class as EffectClass
import Test.Spec as Spec
import HTTPure.Status as Status
2017-10-26 21:19:30 +00:00
import Test.HTTPure.TestHelpers as TestHelpers
import Test.HTTPure.TestHelpers ((?=))
2017-10-26 21:19:30 +00:00
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
2017-10-26 21:19:30 +00:00
statusSpec :: TestHelpers.Test
statusSpec =
Spec.describe "Status" do
writeSpec