Skip to content

treppo/moco-scala

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moco-scala

Build Status

This is a scala wrapper for moco, based on the unmaintained moco-scala by Nicholas Ren. In contrast to the the previous versions by Nicholas, the Moco server does not have mutable state.

How to use

Add dependency

libraryDependencies += "org.treppo" %% "moco-scala" % "0.5.2" % Test

Quick Start

// Import dependencies
import org.treppo.mocoscala.dsl.Moco._

// Create server with port
val theServer = server(8080) when { uri("/hello") } respond { status(200) }

// Create server with random port
val theServer = server when { uri("/hello") } respond { status(200) }

// Running server and test your stuff
theServer running  { uri: URI =>
  assert(SomeHttpClient().url(uri).get.status === 200)
}

Documentation

Detailed feature documentation can be found in the doc/api.md

Also, please refer to functional tests.

Contribution:

Questions, suggestions or pull requests are more than welcome in the Issues section.

License

Licensed under the MIT license

About

scala dsl for moco

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 99.7%
  • Shell 0.3%