moco-scala
moco-scala copied to clipboard
scala dsl for moco
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.
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.