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

53 lines
1.4 KiB
Haskell
Raw Normal View History

2017-10-26 21:19:30 +00:00
module Test.HTTPure.MethodSpec where
2017-09-26 06:08:07 +00:00
import Prelude
import Test.Spec as Spec
import HTTPure.Method as Method
2017-10-26 21:19:30 +00:00
import Test.HTTPure.TestHelpers as TestHelpers
import Test.HTTPure.TestHelpers ((?=))
2017-09-26 06:08:07 +00:00
2017-10-26 21:19:30 +00:00
showSpec :: TestHelpers.Test
2017-09-26 06:08:07 +00:00
showSpec = Spec.describe "show" do
Spec.describe "with a Get" do
Spec.it "is 'Get'" do
show Method.Get ?= "Get"
Spec.describe "with a Post" do
Spec.it "is 'Post'" do
show Method.Post ?= "Post"
Spec.describe "with a Put" do
Spec.it "is 'Put'" do
show Method.Put ?= "Put"
Spec.describe "with a Delete" do
Spec.it "is 'Delete'" do
show Method.Delete ?= "Delete"
Spec.describe "with a Head" do
Spec.it "is 'Head'" do
show Method.Head ?= "Head"
Spec.describe "with a Connect" do
Spec.it "is 'Connect'" do
show Method.Connect ?= "Connect"
Spec.describe "with a Options" do
Spec.it "is 'Options'" do
show Method.Options ?= "Options"
Spec.describe "with a Trace" do
Spec.it "is 'Trace'" do
show Method.Trace ?= "Trace"
Spec.describe "with a Patch" do
Spec.it "is 'Patch'" do
show Method.Patch ?= "Patch"
2017-10-26 21:19:30 +00:00
readSpec :: TestHelpers.Test
2017-09-26 06:08:07 +00:00
readSpec = Spec.describe "read" do
Spec.describe "with a 'GET' Request" do
Spec.it "is Get" do
2017-10-26 21:19:30 +00:00
request <- TestHelpers.mockRequest "GET" "" "" []
2017-09-26 06:08:07 +00:00
Method.read request ?= Method.Get
2017-10-26 21:19:30 +00:00
methodSpec :: TestHelpers.Test
2017-09-26 06:08:07 +00:00
methodSpec = Spec.describe "Method" do
showSpec
readSpec