File: RouteSpec.hs

package info (click to toggle)
mighttpd2 4.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 212 kB
  • sloc: haskell: 1,287; ansic: 44; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# 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/"]]