purescript-httpurple/test/Test/HTTPure/StatusSpec.purs
Thomas Honeyman 42bf4475e0
Update for PureScript 0.15 (#194)
* Update shell and packages

* Fix code for 0.15

* Fix tests

* Format

* Add check-pulp command

* Generate bowerfile

* Add check-pulp to CI

* Add nixfmt to formatting

* Fixup test helpers

* Take 2

* PR comments (#1)

* Nix cleanup from PR

* Use arrows functions

* Remove unnecessary step

Co-authored-by: Connor Prussin <connor@prussin.net>
2022-05-04 14:02:29 -07:00

25 lines
545 B
Haskell

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