-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.hs
29 lines (26 loc) · 999 Bytes
/
test.hs
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
28
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Test.Hspec
import Web.Heroku
import Web.Heroku.RabbitMQ
main :: IO ()
main = hspec $ do
describe "parseDatabaseUrl" $
it "extracts individual items" $
parseDatabaseUrl "postgres://db:[email protected]:1234/db" `shouldBe`
[ ("user","db")
, ("password","pass")
, ("host","ec2-1-1-1-1.compute-1.amazonaws.com")
, ("port","1234")
, ("dbname","db")
]
describe "parseAmqpUrl" $
it "extracts amqp connection settings" $
parseAmqpUrl "amqp://ebA3ec8f:54EnktG1MgGvwPftC4y7BfZIQTYqrtvD@massive-scale-12.bigwig.lshift.net:10210/Uao4j39t8qD_" `shouldBe`
AmqpSettings
{ amqpHostName = "massive-scale-12.bigwig.lshift.net"
, amqpVirtualHost = "Uao4j39t8qD_"
, amqpUser = "ebA3ec8f"
, amqpPass = "54EnktG1MgGvwPftC4y7BfZIQTYqrtvD"
, amqpPort = 10210
}