nicholasren / moco-scala   0.2.1

MIT License GitHub

scala dsl for moco

Scala versions: 2.11

moco-scala

This is a scala wrapper for moco. The purpose of this project is to leverage scala's elegant syntax to provide beautiful DSL for using moco in scala testing.

Build Status

How to use

Add dependency:

libraryDependencies += "com.github.nicholasren" %% "moco-scala" % "0.3"

Try latest version:

if you want to try latest version, just add snapshot repo to dependency resolver

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

Quick Start:

Import dependencies

import com.github.nicholasren.moco.scala.dsl.SMoco._

Create server

val theServer = server(8080)

Record behaviour

theServer when { uri("/hello") } then { status(200) }

Running server and test your stuff

theServer running  {
    assert(getForStatus(remoteUrl("/hello")) === 200)
}

Document

api document can be found here.

also, please refer to functional tests for detail usage.

Contribution:

This project is still in process, any question and suggestion are more than welcomed.