Skip to content

nicholasren/moco-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

scala dsl for moco

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages