Helper class used by code generated by the require macro.
Require that a boolean condition about an argument passed to a method, function, or constructor,
and described in the given clue, is true.
Require that a boolean condition about an argument passed to a method, function, or constructor,
and described in the given clue, is true.
If the condition is true, this method returns normally.
Else, it throws IllegalArgumentException with the
String obtained by invoking toString on the
specified clue and appending that to the macro-generated
error message as the exception's detail message.
the boolean condition to check as requirement
an objects whose toString method returns a message to include in a failure report.
if the condition is false.
if message is null.
Require that a boolean condition is true about an argument passed to a method, function, or constructor.
Require that a boolean condition is true about an argument passed to a method, function, or constructor.
If the condition is true, this method returns normally.
Else, it throws IllegalArgumentException.
This method is implemented in terms of a Scala macro that will generate an error message. See the main documentation for this trait for examples.
the boolean condition to check as requirement
if the condition is false.
Require that all passed arguments are non-null.
Require that all passed arguments are non-null.
If none of the passed arguments are null, this method returns normally.
Else, it throws NullPointerException with an error message that includes the name
(as it appeared in the source) of each argument that was null.
arguments to check for null value
if any of the arguments are null.
Require that a boolean condition about the state of an object on which a method has been
invoked, and described in the given clue, is true.
Require that a boolean condition about the state of an object on which a method has been
invoked, and described in the given clue, is true.
If the condition is true, this method returns normally.
Else, it throws IllegalStateException with the
String obtained by invoking toString on the
specified clue appended to the macro-generated error message
as the exception's detail message.
the boolean condition to check as a requirement
an object whose toString method returns a message to include in a failure report.
if the condition is false.
if message is null.
Require that a boolean condition is true about the state of an object on which a method has been invoked.
Require that a boolean condition is true about the state of an object on which a method has been invoked.
If the condition is true, this method returns normally.
Else, it throws IllegalStateException.
This method is implemented in terms of a Scala macro that will generate an error message.
the boolean condition to check as requirement
if the condition is false.
Helper instance used by code generated by macro assertion.
Helper instance used by code generated by macro assertion.
Companion object that facilitates the importing of
Requirementsmembers as an alternative to mixing it in. One use case is to importRequirementsmembers so you can use them in the Scala interpreter:$scala -classpath scalatest.jar Welcome to Scala version 2.10.3.final (Java HotSpot(TM) Client VM, Java xxxxxx). Type in expressions to have them evaluated. Type :help for more information. scala> import org.scalactic.Requirements._ import org.scalactic.Requirements._ scala> val a = 1 a: Int = 1 scala> require(a == 2) java.lang.IllegalArgumentException: 1 did not equal 2 at org.scalactic.Requirements$RequirementsHelper.macroRequire(Requirements.scala:56) at .<init>(<console>:20) at .<clinit>(<console>) at .<init>(<console>:7) at .<clinit>(<console>) at $print(<console>) at sun.reflect.NativeMethodAccessorImpl.invoke...