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
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
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
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
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
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
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)
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.
delete a file
delete a file
describe a value with the aka method
describe a value with the aka method
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
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
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
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
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
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)
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
a FileInputStream for a given file path
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
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
the files of that directory
matches if new File(path).
matches if new File(path).list == list(files)
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 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
negate a matcher
negate a matcher
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
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
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
implicit definition to transform a Seq of MatchResults to a Result
implicit definition to transform a Seq of MatchResults to a Result
alias for haveSize
alias for haveSize
alias for beSorted
alias for beSorted
matches if b.
matches if b.startsWith(a)
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
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
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
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
alias for beCloseTo
alias for beCloseTo
alias for beCloseTo
alias for beCloseTo