transient class to hold an example description before creating a full Example
The SeqMatcher
class is a matcher matching a sequence of objects with a matcher returned by a function.
The SetMatcher
class is a matcher matching a set of objects with a matcher returned by a function.
matches if a.
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a != b
matches if a != b
adding a conflicting implicit to warn the user when a >>
was forgotten
adding a conflicting implicit to warn the user when a >>
was forgotten
match if the document contains the pair at any level
match if the document contains the pair at any level
match if the document contains the value at any level
match if the document contains the value at any level
match if the document contains the pair at the top level
match if the document contains the pair at the top level
match if the document contains the value at the top-level
match if the document contains the value at the top-level
alias for beLessThan
alias for beLessThan
alias for beLessThanOrEqualTo
alias for beLessThanOrEqualTo
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
matches if a.
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a == b
matches if a == b
matches if a == b after an implicit conversion
matches if a == b after an implicit conversion
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beMatching but matching just a fragment of the string
alias for beGreaterThan
alias for beGreaterThan
alias for beGreaterThanOrEqualTo
alias for beGreaterThanOrEqualTo
at any point in time a regex sequence can be transformed as a sequence of Fragments
at any point in time a regex sequence can be transformed as a sequence of Fragments
implicit definition to create delta for the beCloseTo matcher
implicit definition to create delta for the beCloseTo matcher
alias for \\(node, attributeValues)
with the node label only
alias for \\(node, attributeValues)
with the node label only
match if node
is the first node of the tested node and has exactly the attributeValues
as names and values for its attributes
match if node
is the first node of the tested node and has exactly the attributeValues
as names and values for its attributes
alias for \(node)
with the node label only
alias for \(node)
with the node label only
match if node
is the first node of the tested node
match if node
is the first node of the tested node
match if node
is the first node of the tested node
an exact match on is required on attributes
match if node
is the first node of the tested node
an exact match on is required on attributes
alias for \\(node, attributeValues)
with the node label only
alias for \\(node, attributeValues)
with the node label only
match if node
is contained anywhere inside the tested node and has exactly the attributeValues
as names and values for its attributes
match if node
is contained anywhere inside the tested node and has exactly the attributeValues
as names and values for its attributes
alias for \\(node)
with the node label only
alias for \\(node)
with the node label only
match if node
is contained anywhere inside the tested node
match if node
is contained anywhere inside the tested node
match if node
is contained anywhere inside the tested node
an exact match on is required on attributes
match if node
is contained anywhere inside the tested node
an exact match on is required on attributes
this syntax allows to declare auto examples with { .
this syntax allows to declare auto examples with { ... }.eg in mutable specifications
add a new action to the Fragments
add a new action to the Fragments
append some content to a file and take care of closing the file.
append some content to a file and take care of closing the file.
Usage:
write("./dir/hello.txt") { out =>
out.write("content")
}
path of the file to write
writes some content to a file.
writes some content to a file.
path of the file to read
content of the file to write
writes some xml content to a file.
writes some xml content to a file.
path of the file to read
content of the file to write
shorthand method to create an Arguments object
shorthand method to create an Arguments object
Arguments creation
Arguments creation
a Fragments object which can be chained with other fragments
implicit definition to transform any MatchResult to a Result
implicit definition to transform any MatchResult to a Result
verify the function f for at least one value
verify the function f for at least one value
verify the function f for at least one value, where the PartialFunction is defined
verify the function f for at least one value, where the PartialFunction is defined
alias for beTheSameAs
alias for beTheSameAs
matches if file.
matches if file.isDirectory
matches if new File(path).
matches if new File(path).isDirectory
matches if file.
matches if file.isFile
matches if new File(path).
matches if new File(path).isFile
matches if new File(path).
matches if new File(path).isHidden
matches if new File(path).
matches if new File(path).canRead
matches if new File(path).
matches if new File(path).canWrite
matches if file.
matches if file.isAbsolute
matches if new File(path).
matches if new File(path).isAbsolute
matches if new File(path).
matches if new File(path).exists
matches if a is null when v is null and a is not null when v is not null
matches if a is null when v is null and a is not null when v is not null
matches if v.
matches if v.isAssignableFrom(c)
matches if x = n +/- delta
matches if x = n +/- delta
matches if x = n +/- delta
matches if x = n +/- delta
matches if the partial function is defined at those values
matches if the partial function is defined at those values
matches if the partial function is defined at those values and return expected values
matches if the partial function is defined at those values and return expected values
matches if a.
matches if a.isEmpty
matches if a == b
matches if a == b
matches if 2 paths are the same regardless of their separators
matches if 2 paths are the same regardless of their separators
match if node
is equal to the tested node without testing empty text
match if node
is equal to the tested node without testing empty text
matches if a == false
matches if a == false
matches if x > n
matches if x > n
matches if x >= n
matches if x >= n
matches if file.
matches if file.isHidden
matches if x < n
matches if x < n
matches if x <= n
matches if x <= n
matches if the value returns a successful result when applied to a PartialFunction
matches if the value returns a successful result when applied to a PartialFunction
matches if b matches the regex a
matches if b matches the regex a
matches if b matches the pattern a
matches if b matches the pattern a
matches if b matches the regular expression a
matches if b matches the regular expression a
matches if the value is null
matches if the value is null
matches if t.
matches if t.toSeq.exists(_ == v)
matches if file.
matches if file.canRead
a matcher checking if the elements are ordered
matches if a eq b
matches if a eq b
matches if a == true
matches if a == true
matches if a == b
matches if a == b
matches if file.
matches if file.canWrite
matches if a != b
matches if a != b
matches if a.
matches if a.toLowerCase.trim != b.toLowerCase.trim
matches if a != b
matches if a != b
alias for beLessThan
alias for beLessThan
alias for beLessThanOrEqualTo
alias for beLessThanOrEqualTo
matches if a == b
matches if a == b
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
matches if a.
matches if a.toLowerCase.trim = b.toLowerCase.trim
matches if a == b
matches if a == b
matches if a == b after an implicit conversion
matches if a == b after an implicit conversion
alias for beGreaterThan
alias for beGreaterThan
alias for beGreaterThanOrEqualTo
alias for beGreaterThanOrEqualTo
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
A value can be tested against another with the === operator.
A value can be tested against another with the === operator. It is equivalent to writing a must_== b
true if the file can be read
true if the file can be written
this method can be overriden to throw exceptions when checking the match result
this method can be overriden to throw exceptions when checking the match result
this method can be overriden to throw exceptions when checking the result
this method can be overriden to throw exceptions when checking the result
shortcut to set new Colors
shortcut to set new Colors
matches if (b contains a)
matches if (b contains a)
matches if (b contains a)
matches if (b contains a)
match if traversable contains (t1, t2)
match if traversable contains (t1, t2)
match if an traversable contains (t).
match if an traversable contains (t). This definition looks redundant with the one below but it is necessary to avoid the implicit argThat method from Mockito to infer an improper matcher
the HtmlPrinterSpec failing with a NPE if that method is missing
match if traversable contains (seq2).
match if traversable contains (seq2). n is a dummy paramter to allow overloading
match if traversable contains one of (t1, t2)
match if traversable contains one of (t1, t2)
matches if 1 lines content contains the lines of the other one
matches if 1 lines content contains the lines of the other one
match if traversable contains (x matches .
match if traversable contains (x matches .*+t+.*)
match if traversable contains (x matches p)
match if traversable contains (x matches p)
transform a context to a result to allow the implicit passing of a context to each example
transform a context to a result to allow the implicit passing of a context to each example
Copy an input stream to an output stream.
Copy an input stream to an output stream.
input stream
output stream
copy the content of a directory to another.
copy the content of a directory to another.
destination directory path
copy the content of a directory to another.
copy the content of a directory to another.
url of the directory to copy
destination directory path
Copy the content of a directory to another.
Copy the content of a directory to another.
path of the file to copy
destination directory path
Copy specs resources found either in the specs jar or in the classpath directories to an output directory
Copy specs resources found either in the specs jar or in the classpath directories to an output directory
name of the resource directory to copy
output directory where to copy the files to
creates a directory for a given path
creates a directory for a given path
an Expectable with a description function
an Expectable with a description function
an Expectable with a description
an Expectable
an Expectable with a function to show the element T
creates a file for a given path.
creates a file for a given path. Create the parent directory if necessary.
specific implicits for datatables
specific implicits for datatables
delete a file
delete a file
shortcut to display the example descriptions from the expectations ok messages
shortcut to display the example descriptions from the expectations ok messages
describe a value with the aka method
describe a value with the aka method
shortcut to display the differences with some specific parameters
shortcut to display the differences with some specific parameters
add an after action to any kind of result
add an after action to any kind of result
add an Around function to any kind of result
add an Around function to any kind of result
add a before action to any kind of result
add a before action to any kind of result
implicit conversion to transform a Given[Y] to Given[X] when Y <: X
implicit conversion to transform a Given[Y] to Given[X] when Y <: X
explicit call
explicit call
explicit call The result type is different from the eg method to create examples in order to avoid an overloading error
explicit call The result type is different from the eg method to create examples in order to avoid an overloading error
explicit call.
explicit call. The result type is different from the eg method to create examples in order to avoid an overloading error
explicit call
explicit call
matches if b.
matches if b.endsWith(a)
matches if a == b
matches if a == b
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
alias for beEqualToIgnoringSpace
a matcher that will retry the nested matcher 40 times
a matcher that will retry the nested matcher a given number of times
a result that is retried at least 40 times until it's ok
a matcher that will retry the nested matcher a given number of times
shortcut to exclude some tagged fragments
shortcut to exclude some tagged fragments
shortcut to add exclude trace patterns
shortcut to add exclude trace patterns
shortcut to create a stackTrace filter to exclude only some elements
shortcut to create a stackTrace filter to exclude only some elements
matches if file.
matches if file.exists
true if the file exists
glob expression, for example: ./dir/**/.xml
the list of paths represented by the "glob" definition path
matches if the regexp r is found inside b
matches if the regexp r is found inside b
matches if the pattern p is found inside b
matches if the pattern p is found inside b
matches if the regexp a is found inside b
matches if the regexp a is found inside b
Example creation
Example creation
an Example description from a string, to create a full Example once the body is defined
verify the function f for all the values, stopping after the first failure
verify the function f for all the values, stopping after the first failure
verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined
verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined
verify the function f for all the values, and collect all failures
verify the function f for all the values, and collect all failures
verify the function f for all the values, and collect all failures, where the PartialFunction is defined
verify the function f for all the values, and collect all failures, where the PartialFunction is defined
This implicit allows to follow a fragment by a Formatting fragment
This implicit allows to follow a fragment by a Formatting fragment
a Fragments object from a single Fragment
This implicit allows to follow a Fragments object by a Formatting fragment
This implicit allows to follow a Fragments object by a Formatting fragment
This implicit allows to follow a FragmentsFragment object by a Formatting fragment
This implicit allows to follow a FragmentsFragment object by a Formatting fragment
reverse conversion from a Fragment containing a Fragments object to the Fragments object
reverse conversion from a Fragment containing a Fragments object to the Fragments object
shortcut to not executing the text and avoid automatic indentation
shortcut to not executing the text and avoid automatic indentation
implicit definition to accept any MatchResult as a Boolean value.
implicit definition to accept any MatchResult as a Boolean value. It is true if the MatchResult is not an Error or a Failure
shortcut to filter nothing
shortcut to filter nothing
This method transform a function to a Matcher
This method transform a function to a Matcher
This method transform a function, with function descriptors to a Matcher
This method transform a function, with function descriptors to a Matcher
This method transform a function to a Matcher
This method transform a function to a Matcher
This method transform a function to a Matcher
This method transform a function to a Matcher
the file absolute path
the file canonical path
get the description from the source file
get the description from the source file
the file name
the file parent path
The getWriter function can be overriden to provide a mock writer writing to the console for example
The getWriter function can be overriden to provide a mock writer writing to the console for example
a Writer object opened on the file designated by path
the regular expression equivalent to a glob pattern (see the specs for Fragments)
Create GWT fragments with the << syntax for a mutable specification
Create GWT fragments with the << syntax for a mutable specification
Matches if there is one element in the traversable verifying the function
parameter: (traversable.exists(function(_))
Matches if there is one element in the traversable verifying the function
parameter: (traversable.exists(function(_))
matches if file.
matches if file.getAbsolutePath == path
matches if new File(path).
matches if new File(path).getAbsolutePath == absolutePath
matches if new File(path).
matches if new File(path).getCanonicalPath == canonicalPath
matches if file.
matches if file.getCanonicalPath == path
matches if v.
matches if v.getClass == c
matches if x.
matches if x.getClass.getInterfaces.contains(T)
matches if map.
matches if map.contains(k)
matches if map.
matches if map.contains(k) forall key k
alias for haveSize
alias for haveSize
matches if file.
matches if file.list == list
matches if file.
matches if file.getName == name
matches if map contains a pair (key, value) == (k, v)
matches if map contains a pair (key, value) == (k, v)
matches if map contains all the specified pairs
matches if map contains all the specified pairs
matches if file.
matches if file.getParent == path
matches if new File(path).
matches if new File(path).getParent == parent
matches if new File(path).
matches if new File(path).getName == name
matches if 2 contents, as a pair, have the same lines
matches if 2 contents, as a pair, have the same lines
matches if 2 contents have the same lines
matches if 2 contents have the same lines
match if there is a way to size T
match if there is a way to size T
matches if c.
matches if c.isAssignableFrom(v.getClass.getSuperclass)
Matches if there l contains the same elements as the Traversable traversable
.
Matches if there l contains the same elements as the Traversable traversable
.
This verification does not consider the order of the elements but checks the traversables recursively
matches if map contains a pair (key, value) with value == v
matches if map contains a pair (key, value) with value == v
matches if map contains a pair (key, value) with value == v for all value v
matches if map contains a pair (key, value) with value == v for all value v
specName provides useful information identifying the specification: title, className, url.
specName provides useful information identifying the specification: title, className, url...
automatically convert a specification to its identification
automatically convert a specification to its identification
add a new example using 'in' or '>>' or '!'
add a new example using 'in' or '>>' or '!'
transform a scope to a success to be able to create traits containing any variables and usable in any Examples
transform a scope to a success to be able to create traits containing any variables and usable in any Examples
shortcut to include only some tagged fragments
shortcut to include only some tagged fragments
shortcut to add include trace patterns
shortcut to add include trace patterns
shortcut to create a stackTrace filter to include only some elements
shortcut to create a stackTrace filter to include only some elements
a FileInputStream for a given file path
declaration of Fragments from the user
declaration of Fragments from the user
true if the file is absolute
true if the File represented by this path is a directory
true if the file is a directory
true if the file is a file
true if the file is hidden
arguments for a specification where examples must be executed in their own specification
any java collection has a size
any java collection has a size
transform a value to a zero-arg function returning that value
transform a value to a zero-arg function returning that value
alias for haveSize
alias for haveSize
add a new link to the Fragments
add a new link to the Fragments
create a link directly on a specification, with a given link
create a link directly on a specification, with a given link
create a link directly on a specification
create a link directly on a specification
the files of that directory
matches if new File(path).
matches if new File(path).list == list(files)
arguments for a literate specification: no auto indent and a sequential execution
the xml content of a file using the Xhtml parser
if the file contains several nodes, it wraps them up in a single artificial node
the xml content of a file, using the XML parser
this method can be overriden to map additional behavior in the user-defined fragments
this method can be overriden to map additional behavior in the user-defined fragments
this implicit def is necessary when the expression is at the start of the spec The startDepth and offsets are special tweakings to make sure we get the right line in that specific case
this implicit def is necessary when the expression is at the start of the spec The startDepth and offsets are special tweakings to make sure we get the right line in that specific case
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
This method transform a function returning a MatchResult to a Matcher
This method transform a function returning a MatchResult to a Matcher
this method can be overriden to intercept the transformation of a MatchResult to a Result
this method can be overriden to intercept the transformation of a MatchResult to a Result
Add functionalities to functions returning matchers so that they can be combined before taking a value and returning actual matchers
Add functionalities to functions returning matchers so that they can be combined before taking a value and returning actual matchers
creates a new directory
creates a new directory
shortcut to avoid colored output
shortcut to avoid colored output
shortcut to avoid automatic indentation
shortcut to avoid automatic indentation
negate a matcher
negate a matcher
shortcut to execute and print only some examples
shortcut to execute and print only some examples
use an available outside context to transform a function returning a value convertible to a result, into a result
use an available outside context to transform a function returning a value convertible to a result, into a result
This method transform a function returning a pair (Boolean, String for ko message) to a Matcher
This method transform a function returning a pair (Boolean, String for ko message) to a Matcher
shortcut to show only the text without any execution
shortcut to show only the text without any execution
reads the content of a file
reads the content of a file
the path of the file to read
the content of the file at path
deletes the directory and all directory content at the specified path and return the parent path of that directory
deletes the directory and all directory content at the specified path and return the parent path of that directory
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
this implicit def is necessary when the expression is at the start of the spec
true if 2 paths are the same according to their canonical representation
any scala array has a size
any scala array has a size
any scala collection has a size
any scala collection has a size
create a see-only link directly on a specification, with a given link
create a see-only link directly on a specification, with a given link
create a html link without including the other specification fragments
create a html link without including the other specification fragments
implicit definition to transform a Seq of MatchResults to a Result
implicit definition to transform a Seq of MatchResults to a Result
arguments for a specification where examples must be executed sequentially
shortcut to print only some statuses
shortcut to print only some statuses
alias for haveSize
alias for haveSize
shortcut to skip all examples
shortcut to skip all examples
shortcut to skip all examples when a condition is true.
shortcut to skip all examples when a condition is true. if the condition throws an exception, its stacktrace is *not* printed and all the examples are skipped
shortcut to skip all examples when a condition is false.
shortcut to skip all examples when a condition is false.
alias for beSorted
alias for beSorted
local mutable contents of the specification
local mutable contents of the specification
create markdown links from string + spec identification
create markdown links from string + spec identification
this implicit allows to call some functions directly on a specification, like 'hide'
this implicit allows to call some functions directly on a specification, like 'hide'
matches if b.
matches if b.startsWith(a)
add a new step to the Fragments
add a new step to the Fragments
shortcut to stop after the first failure or error
shortcut to stop after the first failure or error
shortcut to stop after the first skipped result
shortcut to stop after the first skipped result
a regular string has a size, without having to be converted to an Traversable
a regular string has a size, without having to be converted to an Traversable
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
adapt the BeEqualTo matcher to provide ignoreCase and ignoreSpace matcher
Links to other specifications creation
Links to other specifications creation
org.specs2.UserGuide
This implicit allows to follow a string object by a Formatting fragment
This implicit allows to follow a string object by a Formatting fragment
a Fragments object from a single piece of text
a Fragments object from a string
a matcher checking the value of an Exception
a matcher checking the type of an Exception and its message (as a regexp)
a matcher checking the type of an Exception
alias for throwA
alias for throwA
alias for throwA
alias for throwA
alias for throwA
alias for throwA
This method allows to add a title to the Specification.
This method allows to add a title to the Specification. It can be used as an operation on a String:
"spec title".title
a Fragments object from a string, with the given title
matcher aliases and implicits to use with BeVerb and HaveVerb
matcher aliases and implicits to use with BeVerb and HaveVerb
matcher aliases and implicits to use with BeVerb and HaveVerb
matcher aliases and implicits to use with BeVerb and HaveVerb
matcher aliases and implicits to use with be + matcher
matcher aliases and implicits to use with be + matcher
matcher aliases and implicits to use with be / have + matcher
matcher aliases and implicits to use with be / have + matcher
implicit definition to accept any boolean value as a Result This avoids writing b must beTrue
implicit definition to accept any boolean value as a Result This avoids writing b must beTrue
This method transform a function returning a triplet (Boolean, String for ok message, String for ko message) to a Matcher
This method transform a function returning a triplet (Boolean, String for ok message, String for ko message) to a Matcher
matches if a == b
matches if a == b
Unjar the jar (or zip file) specified by "path" to the "dest" directory.
Unjar the jar (or zip file) specified by "path" to the "dest" directory. Filters files which shouldn't be extracted with a regular expression.
path of the jar file
regular expression filtering files which shouldn't be extracted
Unjar the jar (or zip file) specified by "path" to the "dest" directory.
Unjar the jar (or zip file) specified by "path" to the "dest" directory.
path of the jar file
destination directory path
implicit conversion to transform a Then[Y] to Then[X] when Y <: X
implicit conversion to transform a Then[Y] to Then[X] when Y <: X
implicit conversion to transform a When[P, Q] to When[R, S] when R <: P and S >: Q
implicit conversion to transform a When[P, Q] to When[R, S] when R <: P and S >: Q
shortcut to include only examples with some previous statuses
shortcut to include only examples with some previous statuses
shortcut to include only previousy failed/errors examples
shortcut to include only previousy failed/errors examples
writes some content to a file and take care of closing the file.
writes some content to a file and take care of closing the file.
Usage:
write("./dir/hello.txt") { out =>
out.write("content")
}
path of the file to write
writes some content to a file.
writes some content to a file.
path of the file to read
content of the file to write
writes some xml content to a file.
writes some xml content to a file.
path of the file to read
content of the file to write
shortcut to print only failures and errors
shortcut to print only failures and errors
alias for beCloseTo
alias for beCloseTo
alias for beCloseTo
alias for beCloseTo