2017-10-26 21:19:30 +00:00
|
|
|
module Test.HTTPure.StatusSpec where
|
2017-07-17 23:42:13 +00:00
|
|
|
|
2017-07-18 05:31:46 +00:00
|
|
|
import Prelude
|
2017-07-17 23:42:13 +00:00
|
|
|
|
2018-07-08 23:16:48 +00:00
|
|
|
import Effect.Class as EffectClass
|
2017-07-17 23:42:13 +00:00
|
|
|
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-07-17 23:42:13 +00:00
|
|
|
|
2017-10-26 21:19:30 +00:00
|
|
|
writeSpec :: TestHelpers.Test
|
2017-07-17 23:42:13 +00:00
|
|
|
writeSpec = Spec.describe "write" do
|
|
|
|
Spec.it "writes the given status code" do
|
2018-07-08 23:16:48 +00:00
|
|
|
status <- EffectClass.liftEffect do
|
2017-10-26 21:19:30 +00:00
|
|
|
mock <- TestHelpers.mockResponse
|
2017-07-17 23:42:13 +00:00
|
|
|
Status.write mock 123
|
2017-10-26 21:19:30 +00:00
|
|
|
pure $ TestHelpers.getResponseStatus mock
|
2017-07-19 05:36:56 +00:00
|
|
|
status ?= 123
|
2017-07-17 23:42:13 +00:00
|
|
|
|
2017-10-26 21:19:30 +00:00
|
|
|
statusSpec :: TestHelpers.Test
|
2017-07-17 23:42:13 +00:00
|
|
|
statusSpec = Spec.describe "Status" do
|
|
|
|
writeSpec
|