File: RouteSpec.hs

package info (click to toggle)
mighttpd2 4.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: haskell: 1,382; makefile: 4; sh: 3
file content (27 lines) | stat: -rw-r--r-- 737 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE OverloadedStrings #-}

module RouteSpec where

import Test.Hspec

import Program.Mighty

spec :: Spec
spec = do
    describe "parseRoute" $ do
        it "parses example.route correctly" $ do
            res <- parseRoute "conf/example.route" "localhost" 80
            res `shouldBe` ans

ans :: [Block]
ans =
    [ Block
        ["localhost", "www.example.com"]
        [ RouteCGI "/~alice/cgi-bin/" "/home/alice/public_html/cgi-bin/"
        , RouteFile "/~alice/" "/home/alice/public_html/"
        , RouteCGI "/cgi-bin/" "/export/cgi-bin/"
        , RouteRevProxy "/app/cal/" "/calendar/" "example.net" 80
        , RouteRevProxy "/app/wiki/" "/" "127.0.0.1" 3000
        , RouteFile "/" "/export/www/"
        ]
    ]