purescript-httpurple/test/Test/Main.purs
Hardy Jones c208dffb7b Add HTTP version (#137)
* v0.8.1

* Add the HTTP version to `Request`

The `node-http` `Request` has the HTTP version on it.
We can make it available in our `Request` for consumers.

We went the naive approach first and typed it as a string.
There is some structure to the version,
so we could attempt to parse it.
It's unclear what we would do if parsing failed though.

Maybe we want something like:
```PureScript
data Version
  = Known { major :: Int, minor :: Int }
  | Unknown String
```

That would allow us to parse the known format,
and fallback to accepting anything else.
It's definitely something to discuss anyway.

* Make HTTP version its own data type

There are only a handful of HTTP versions that are commonly used.
We can talk about those explicitly and fallback to any arbitrary version.

The changes here try to follow the patterns elsewhere in the code base.
Hopefully, it's not too far off.
2019-04-25 10:13:04 -07:00

38 lines
1.1 KiB
Haskell

module Test.Main where
import Prelude
import Test.Spec as Spec
import Test.Spec.Reporter as Reporter
import Test.Spec.Runner as Runner
import Test.HTTPure.BodySpec as BodySpec
import Test.HTTPure.HeadersSpec as HeadersSpec
import Test.HTTPure.LookupSpec as LookupSpec
import Test.HTTPure.MethodSpec as MethodSpec
import Test.HTTPure.PathSpec as PathSpec
import Test.HTTPure.QuerySpec as QuerySpec
import Test.HTTPure.RequestSpec as RequestSpec
import Test.HTTPure.ResponseSpec as ResponseSpec
import Test.HTTPure.ServerSpec as ServerSpec
import Test.HTTPure.StatusSpec as StatusSpec
import Test.HTTPure.VersionSpec as VersionSpec
import Test.HTTPure.IntegrationSpec as IntegrationSpec
import Test.HTTPure.TestHelpers as TestHelpers
main :: TestHelpers.TestSuite
main = Runner.run [ Reporter.specReporter ] $ Spec.describe "HTTPure" do
BodySpec.bodySpec
HeadersSpec.headersSpec
LookupSpec.lookupSpec
MethodSpec.methodSpec
PathSpec.pathSpec
QuerySpec.querySpec
RequestSpec.requestSpec
ResponseSpec.responseSpec
ServerSpec.serverSpec
StatusSpec.statusSpec
VersionSpec.versionSpec
IntegrationSpec.integrationSpec