2017-07-17 23:42:13 +00:00
|
|
|
module HTTPure.StatusSpec where
|
|
|
|
|
2017-07-18 05:31:46 +00:00
|
|
|
import Prelude
|
2017-07-17 23:42:13 +00:00
|
|
|
|
|
|
|
import Control.Monad.Eff.Class as EffClass
|
|
|
|
import Test.Spec as Spec
|
|
|
|
|
|
|
|
import HTTPure.Status as Status
|
|
|
|
|
|
|
|
import HTTPure.SpecHelpers as SpecHelpers
|
2017-07-19 05:36:56 +00:00
|
|
|
import HTTPure.SpecHelpers ((?=))
|
2017-07-17 23:42:13 +00:00
|
|
|
|
|
|
|
writeSpec :: SpecHelpers.Test
|
|
|
|
writeSpec = Spec.describe "write" do
|
|
|
|
Spec.it "writes the given status code" do
|
|
|
|
status <- EffClass.liftEff do
|
|
|
|
mock <- SpecHelpers.mockResponse
|
|
|
|
Status.write mock 123
|
|
|
|
pure $ SpecHelpers.getResponseStatus mock
|
2017-07-19 05:36:56 +00:00
|
|
|
status ?= 123
|
2017-07-17 23:42:13 +00:00
|
|
|
|
|
|
|
statusSpec :: SpecHelpers.Test
|
|
|
|
statusSpec = Spec.describe "Status" do
|
|
|
|
writeSpec
|