org.specs

class Specification

[source: org/specs/Specification.scala]

abstract class Specification
extends Matchers with SpecificationStructure with AssertFactory
This class is the main class for declaring a new specification
In the context of a specification, you can: Usage: object mySpec extends Specification

A specification is "executed" when it is constructed, then the failures and errors can be collected with the corresponding methods

Direct Known Subclasses:
LiteralSpecification

Values and Variables inherited from SpecificationStructure
description, name, subSpecifications, suts
Values and Variables inherited from ExampleLifeCycle
sequential, example
Method Summary
def assertionsNb : Int
def doAfter (actions : => Any) : Unit
adds an "after" function to the last sut being defined
def doBefore (actions : => Any) : Unit
adds a "before" function to the last sut being defined
def errors : scala.List[java.lang.Throwable]
def fail (m : java.lang.String) : Nothing
Convenience method: adds a new failure to the latest example
Usage: fail("this code should fail anyway")
def failures : scala.List[FailureException]
def pretty : java.lang.String
def skip (m : java.lang.String) : Nothing
Convenience method: adds a new skippedException to the latest example
Usage: skip("this example should be skipped")
def skipped : scala.List[SkippedException]
def usingAfter (afterFunction : () => Unit) : Unit
def usingBefore (beforeFunction : () => Unit) : Unit
Methods inherited from AssertFactory
addAssertion, theString, theValue, theBlock, toStringIterableAssert, toIterableAssert
Methods inherited from SpecificationStructure
createDescription, isSpecifiedBy, areSpecifiedBy, declare, specify, currentSut, forExample, exampleContainer
Methods inherited from ExampleLifeCycle
isSequential, setSequential, beforeExample, beforeTest, afterTest, executeTest, afterExample
Methods inherited from MatcherResult
toMatcherResult, toTuple
Methods inherited from XmlMatchers
\\, \\, \\, \\, \\, \\, \, \, \, \, \, \, equalIgnoreSpace, ==/
Methods inherited from MockMatchers
beMet, any
Methods inherited from PatternMatchers
beLike, beNone, beSome, beSomething
Methods inherited from ScalacheckMatchers
defaultParameters, pass, pass, pass, pass, checkFunction, checkProperty, checkScalacheckProperty
Methods inherited from ScalacheckFunctions
check, forAll
Methods inherited from ConsoleOutput
println, printf, flush
Methods inherited from NumericMatchers
beStrictlyLessThan, be_<, beStrictlyGreaterThan, be_>, beLessThan, be_<=, beGreaterThan, be_>=, beCloseTo
Methods inherited from MapMatchers
haveKey, notHaveKey, haveValue, notHaveValue, havePair, notHavePair, beDefinedAt, beDefinedBy
Methods inherited from IterableMatchers
contain, notContain, exist, notExist, existMatch, containMatch, notExistMatch, haveSameElementsAs
Methods inherited from StringMatchers
equalIgnoreCase, notEqualIgnoreCase, include, notInclude, beMatching, notBeMatching, startWith, notStartWith, endWith, notEndWith
Methods inherited from LogicalMatchers
not, verifyAll, verifyAll, verifyAny, verifyAny
Methods inherited from AnyMatchers
be, notBe, beEqual, beDifferent, is_==, be_==, notEq, is_!=, be_!=, beNull, notBeNull, beTrue, beFalse, beIn, notBeIn, beEmpty, notBeEmpty, isNotEmpty, isEmpty, verify, throwException, throwA, throwAn, throwThis, throwFailure
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def usingBefore(beforeFunction : () => Unit) : Unit
Deprecated
adds a "before" function to the last sut being defined

def doBefore(actions : => Any) : Unit
adds a "before" function to the last sut being defined

def usingAfter(afterFunction : () => Unit) : Unit
Deprecated
adds an "after" function to the last sut being defined

def doAfter(actions : => Any) : Unit
adds an "after" function to the last sut being defined

def failures : scala.List[FailureException]
Returns
the failures of each sut

def skipped : scala.List[SkippedException]
Returns
the skipped of each sut

def errors : scala.List[java.lang.Throwable]
Returns
the errors of each sut

def assertionsNb : Int
Returns
the total number of assertions for each sut

def pretty : java.lang.String
Returns
a description of this specification with all its suts (used for the ConsoleReporter)

def fail(m : java.lang.String) : Nothing
Convenience method: adds a new failure to the latest example
Usage: fail("this code should fail anyway")

def skip(m : java.lang.String) : Nothing
Convenience method: adds a new skippedException to the latest example
Usage: skip("this example should be skipped")


Copyright (c) 2007-2008. All Rights Reserved.