Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package scalactic
    Definition Classes
    org
  • object Requirements extends Requirements

    Companion object that facilitates the importing of Requirements members as an alternative to mixing it in.

    Companion object that facilitates the importing of Requirements members as an alternative to mixing it in. One use case is to import Requirements members 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...
    

    Definition Classes
    scalactic
  • RequirementsHelper
Scalactic is brought to you by:
c

org.scalactic.Requirements

RequirementsHelper

class RequirementsHelper extends Serializable

Helper class used by code generated by the require macro.

Source
Requirements.scala
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RequirementsHelper
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RequirementsHelper()

Value Members

  1. def macroRequire(bool: Bool, clue: Any): Unit

    Require that the passed in Bool is true, else fail with IllegalArgumentException.

    Require that the passed in Bool is true, else fail with IllegalArgumentException.

    bool

    the Bool to check as requirement

    clue

    optional clue to be included in IllegalArgumentException's error message when the requirement failed

  2. def macroRequireNonNull(variableNames: Array[String], arguments: Array[Any], prettifier: Prettifier, pos: Position): Unit

    Require that all of the passed in arguments are not null, else fail with NullArgumentException.

    Require that all of the passed in arguments are not null, else fail with NullArgumentException.

    variableNames

    names of variable passed as appear in source

    arguments

    arguments to check for null value

  3. def macroRequireState(bool: Bool, clue: Any): Unit

    Require that the passed in Bool is true, else fail with IllegalStateException.

    Require that the passed in Bool is true, else fail with IllegalStateException.

    bool

    the Bool to check as requirement

    clue

    optional clue to be included in IllegalStateException's error message when the requirement failed