Hspec-Server is test framework for checking server's status. It is inspired by the Ruby library ServerSpec.
Install this from Hackage.
cabal update && cabal install hspec-server
Put "with(ServerType)" after hspec's describe-sentence. Currently localhost, ssh , vagrant and docker(>=1.4.1) are supported for ServerType. Examples are below. "@>=" is like hspec's shouldBe. it can check multiple values.
describe "test for localhost" $ with localhost $ do
it "package zookeepr" $ do
package "zookeeper" @>= installed
it "port test" $ do
port 2181 @>= listening
it "service test" $ do
service "cron" @>= running
it "command test" $ do
command "echo" ["hoge"] [] @>= exit 0 <> stdout "hoge\n"
describe "test for vagrant" $ with (vagrant "servername") $ do
it "port test" $ do
port 2181 @>= listening
describe "test for docker" $ with (docker "containerId") $ do
it "port test" $ do
port 2181 @>= listening