Skip to content

junjihashimoto/hspec-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hspec-Server: Test Framework like ServerSpec for Haskell

Hackage version Build Status Coverage Status

Hspec-Server is test framework for checking server's status. It is inspired by the Ruby library ServerSpec.

Getting started

Install this from Hackage.

cabal update && cabal install hspec-server

Usage

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

About

Test Framework like ServerSpec for Haskell

Resources

License

Stars

Watchers

Forks

Packages

No packages published