org.specs.specification.SusWithContext

class SusWithContext

case class SusWithContext[S](val context : SystemContext[S], val desc : String, val cyc : ExampleLifeCycle)

 extends Sus


The Sus class represents a system under specification
It has: It is also an ExampleLifeCycle so it can refine the passed cycle

In specifications, a Sus "should" or "can" provide some functionalities which are defined in Examples
A Sus is "executed" during its construction and failures and errors are collected from its examples



Companion: SusWithContext

Source: Sus.scala(23)

 Constructors

def this(context : SystemContext[S], desc : String, cyc : ExampleLifeCycle)

 Fields

acceptAnyTag def acceptAnyTag
reset accepted and rejected to an empty queue
Tagged Tagged
accepted val accepted
list of tags which are accepted for this element
Queue[Tag] Tagged
after var after
the after function will be invoked after each example
Option[() => Any] Sus
before var before
the before function will be invoked before each example
Option[() => Any] Sus
clearTags def clearTags
Clear all tags, accepted and rejected
Tagged Tagged
cycle var cycle ExampleLifeCycle Sus
description val description String Sus
errors def errors
[details]
return
- all examples errors
List[Throwable] Sus
example protected[this] var example Option[Example] ExampleLifeCycle
examples var examples
examples describing the sus behaviour
List[Example] Sus
expectationsNb def expectationsNb
[details]
return
- the total number of expectations for this sus
Int Sus
failedSus var failedSus Option[String] Sus
failureAndErrors def failureAndErrors List[Throwable] HasResults
failures def failures
[details]
return
- all examples failures
List[FailureException] Sus
firstActions var firstActions
the firstActions function will be invoked before all examples
Option[() => Any] Sus
hasFailureAndErrors def hasFailureAndErrors Boolean HasResults
hasIssues def hasIssues Boolean HasResults
header def header
header for the full sus description: description + " " + verb
String Sus
isAccepted def isAccepted
Return true if this Tagged element:
  • doesn't have any tags and no tags are marked as accepted
  • or doesn't have any accepted tags
  • or has at least one of the accepted tags and doesn't have any of the rejected tags
[details]
return
- true if the element can be accepted, considering the tags it owns and the accepted/rejected tags
Boolean Tagged
isFullSuccess def isFullSuccess
[details]
return
- true if there are only successes
Boolean Sus
isOk def isOk Boolean HasResults
isSequential def isSequential Boolean ExampleLifeCycle
issueMessages def issueMessages String HasResults
issues def issues List[Throwable] HasResults
lastActions var lastActions
the lastActions function will be invoked after all examples
Option[() => Any] Sus
literateDescription var literateDescription
instead of using several examples, a whole text with embedded expectations can be used to specify the Sus
Option[Elem] Sus
productArity override def productArity Int
productPrefix override def productPrefix String
rejected val rejected
list of tags which are rejected for this element
Queue[Tag] Tagged
resetForExecution def resetForExecution
reset in order to be able to run all the examples again
Sus Sus
sequential protected var sequential Boolean ExampleLifeCycle
skipped def skipped
[details]
return
- all examples skipped messages
List[SkippedException] Sus
skippedSus var skippedSus Option[Throwable] Sus
status def status String HasResults
statusAsText def statusAsText String HasResults
successes def successes
[details]
return
- all the examples with no errors, failures or skip messages
List[Example] Sus
tagSpec def tagSpec
[details]
return
- a description of the Tagged element showing the owned tags, the accepted and rejected tags
String Tagged
taggedComponents override def taggedComponents
Declare the examples as components to be tagged when the sus is tagged
List[Example] Sus
tags val tags
list of all tags
Queue[Tag] Tagged
until override def until
forwards the call to the "parent" cycle
Boolean Sus
untilPredicate var untilPredicate
a predicate which will decide if an example must be re-executed
Option[() => Boolean] Sus
verb var verb
default verb used to define the behaviour of the sus
String Sus

 Methods

!= final def !=(arg0 : Object) Boolean AnyRef
!= final def !=(arg0 : Any) Boolean Any
== final def ==(arg0 : Any) Boolean Any
== final def ==(arg0 : Object) Boolean AnyRef
accept def accept(t : Tag*)
Declare that this element should be accepted only if it has one of the accepted tags [details]
This method declares the same thing for the components of this element.
Tagged Tagged
acceptTag def acceptTag(s : String*)
alias for the acceptTag method
Tagged Tagged
acceptTags def acceptTags(s : String*)
alias for the accept method with strings
Tagged Tagged
addExample def addExample(e : Example)
add an example to the list of examples
Unit Sus
addTag def addTag(t : String)
Add one tag to this element
Tagged Tagged
addTags def addTags(t : String*)
Add one or several tags to this element
Tagged Tagged
afterExample override def afterExample(ex : Example)
calls the after method of the "parent" cycle, then the sus after method after an example if that method is defined
Unit
afterTest override def afterTest(ex : Example)
forwards the call to the "parent" cycle
Unit Sus
asInstanceOf final def asInstanceOf[T0] T0 Any
beforeExample override def beforeExample(ex : Example)
calls the before method of the "parent" cycle, then the sus before method before an example if that method is defined
Unit
beforeTest override def beforeTest(ex : Example)
forwards the call to the "parent" cycle
Unit Sus
can def can(ex : => Example)
Alias method to describe more advanced or optional behaviour [details]
This will change the verb used to report the sus behavior
Sus Sus
clone protected def clone Object AnyRef
cloneExample override def cloneExample(e : Example)
clone the example, possibly attaching context information
Example
copyDefAndSubExamples def copyDefAndSubExamples(e : Example, cloned : Example) Example Sus
createExample override def createExample(desc : String, lifeCycle : ExampleLifeCycle) Example
eq final def eq(arg0 : Object) Boolean AnyRef
equals override def equals(arg0 : Any) Boolean
executeTest override def executeTest(ex : Example, t : => Any)
forwards the call to the "parent" cycle
Any
finalize protected def finalize Unit AnyRef
getClass final def getClass Class[Object] AnyRef
hashCode override def hashCode Int
isInstanceOf final def isInstanceOf[T0] Boolean Any
makeTagged def makeTagged(s : String*)
create another tagged with this new tags
Tagged Tagged
ne final def ne(arg0 : Object) Boolean AnyRef
notify final def notify Unit AnyRef
notifyAll final def notifyAll Unit AnyRef
pretty def pretty(tab : String)
[details]
return
- a description of this sus with all its examples (used for the ConsoleReporter)
String Sus
productElement override def productElement(arg0 : Int) Any
reject def reject(t : Tag*)
Declare that this element should be rejected if it has one of the rejected tags [details]
This method declares the same thing for the components of this element.
Tagged Tagged
rejectTag def rejectTag(s : String*)
alias for the reject method with strings
Tagged Tagged
rejectTags def rejectTags(s : String*)
alias for the reject method with several strings
Tagged Tagged
setSequential def setSequential Unit ExampleLifeCycle
should def should(ex : => Example)
default way of defining the behaviour of a sus
Sus Sus
should def should(noExampleGiven : Unit)
alternately there may be no example given yet
Sus Sus
stringToTag implicit def stringToTag(s : String)
transforms a string to a Tag object
Tag Tagged
synchronized final def synchronized[T0](arg0 : T0) T0 AnyRef
tag def tag(t : String*)
Add one or several tags to this element
Tagged Tagged
tagWith def tagWith(other : Tagged)
add the tags specification from another tagged element [details]
This is used when propagating the tags from a specification to a sus for example
Tagged Tagged
toString override def toString String
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
wait final def wait Unit AnyRef
Copyright (c) 2007-2009. All Rights Reserved.