Skip to content

kiequoo/specs2x

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Specs2x Build Status

Extension for Specs2

Examples

DatabaseSpec

Need to create Database instance, which will be used in specs

import specs2x.Database

val database = new Database {
  def start() {
    // setup database
  }

  def withSession[T](f: => T) = {
    // create session
    f
    // submit session
  }

  def stop() {
    // clean and stop database
  }
}

Then pass database instance to the specification

import specs2x.DatabaseSpec

class ExampleDatabaseSpec extends DatabaseSpec(database) {
  "ExampleDatabase" should {
    "insert record" in success  // each will be called in separate session
    "read record"   in success  // also DatabaseSpec is sequential by default
    "delete record" in success  // if any will fail, we will not go further (sequential ^ stopOnFail)
  }
}

Setup

  1. Add this repository to your pom.xml:
    <repository>
        <id>thenewmotion</id>
        <name>The New Motion Repository</name>
        <url>http://nexus.thenewmotion.com/content/repositories/releases-public</url>
    </repository>
  1. Add dependency to your pom.xml:
    <dependency>
        <groupId>ua.t3hnar.specs2x</groupId>
        <artifactId>specs2x_2.9.2</artifactId>
        <version>1.0</version>
    </dependency>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published