trait FactMatcherWords extends AnyRef
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers for an overview of
the matchers DSL.
- Source
- FactMatcherWords.scala
- Alphabetic
- By Inheritance
- FactMatcherWords
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
be: BeWord
This field enables syntax such as the following:
This field enables syntax such as the following:
obj will (be theSameInstanceAs (string) and be theSameInstanceAs (string)) ^ -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
val
compile: CompileWord
This field enables the following syntax:
This field enables the following syntax:
"val a: String = 1" willNot compile ^ -
val
contain: ContainWord
This field enables syntax such as the following:
This field enables syntax such as the following:
list will (contain ('a') and have length (7)) ^ -
val
defined: DefinedWord
This field enables the following syntax:
This field enables the following syntax:
seq will be (defined) ^ -
val
empty: EmptyWord
This field enables the following syntax:
This field enables the following syntax:
list will be (empty) ^ -
val
endWith: EndWithWord
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (endWith ("ago") and include ("score")) ^ -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equal(right: Any): MatcherFactory1[Any, Equality]
This method enables the following syntax:
This method enables the following syntax:
result will equal (7) ^The
left will equal (right)syntax works by calling==on theleftvalue, passing in therightvalue, on every type except arrays. If bothleftand right are arrays,deepwill be invoked on bothleftandrightbefore comparing them with ==. Thus, even though this expression will yield false, becauseArray'sequalsmethod compares object identity:Array(1, 2) == Array(1, 2) // yields false
The following expression will not result in a
TestFailedException, because ScalaTest will compare the two arrays structurally, taking into consideration the equality of the array's contents:Array(1, 2) will equal (Array(1, 2)) // succeeds (i.e., does not throw TestFailedException)
If you ever do want to verify that two arrays are actually the same object (have the same identity), you can use the
be theSameInstanceAssyntax. -
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
exist: ExistWord
This field enables the following syntax:
This field enables the following syntax:
file will exist ^ -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
val
fullyMatch: FullyMatchWord
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (fullyMatch regex ("Hel*o, wor.d") and not have length (99)) ^ -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
have: HaveWord
This field enables syntax such as the following:
This field enables syntax such as the following:
list will (have length (3) and not contain ('a')) ^ -
val
include: IncludeWord
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (include ("hope") and not startWith ("no")) ^ -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
length: LengthWord
This field enables the following syntax:
This field enables the following syntax:
"hi" will not have length (3) ^ -
val
matchPattern: MatchPatternWord
This field enables the following syntax:
This field enables the following syntax:
result will matchPattern { case Person("Bob", _) => } ^ -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
noException(implicit pos: Position): FactExceptionWord
This field enables the following syntax:
This field enables the following syntax:
noException will be thrownBy ^
-
val
not: NotWord
This field enables syntax like the following:
This field enables syntax like the following:
myFile will (not be an (directory) and not have ('name ("foo.bar"))) ^ -
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
readable: ReadableWord
This field enables the following syntax:
This field enables the following syntax:
file will be (readable) ^ -
val
size: SizeWord
This field enables the following syntax:
This field enables the following syntax:
set will not have size (3) ^ -
val
sorted: SortedWord
This field enables the following syntax:
This field enables the following syntax:
seq will be (sorted) ^ -
val
startWith: StartWithWord
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (startWith ("Four") and include ("year")) ^ -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
typeCheck: TypeCheckWord
This field enables the following syntax:
This field enables the following syntax:
"val a: String = 1" willNot typeCheck ^ -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
val
writable: WritableWord
This field enables the following syntax:
This field enables the following syntax:
file will be (writable) ^