Skip to content

Commit

Permalink
add test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
gregwebs committed Jun 20, 2014
1 parent 2fae65b commit 513b7b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 8 additions & 0 deletions heroku.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ Library
Build-depends: base >= 4 && < 5
, text
, network

Test-Suite test
Type: exitcode-stdio-1.0
Main-Is: test.hs
Build-depends: base >= 4 && < 5
, text
, network
, hspec
15 changes: 13 additions & 2 deletions test.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{-# LANGUAGE OverloadedStrings #-}
module Main where

import Web.Heroku
import Test.Hspec

main = print $ show $
parseDatabaseUrl "postgres://db:pass@ec2-1-1-1-1.compute-1.amazonaws.com:1234/db"
main :: IO ()
main = hspec $
describe "parseDatabaseUrl" $
it "extracts individual items" $
parseDatabaseUrl "postgres://db:pass@ec2-1-1-1-1.compute-1.amazonaws.com:1234/db" `shouldBe`
[ ("user","db")
, ("password","pass")
, ("host","ec2-1-1-1-1.compute-1.amazonaws.com")
, ("port","1234")
, ("dbname","db")
]

0 comments on commit 513b7b1

Please sign in to comment.