Packages

p

claimant

package claimant

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Package Members

  1. package render
  2. package scribe
  3. package tinker

Type Members

  1. sealed abstract class Claim extends AnyRef

    Claim represents a Boolean result with a description of what that result means.

    Claim represents a Boolean result with a description of what that result means.

    Claims can be composed using the same operators as Booleans, which correspond to recursive Claim subtypes (e.g. And, Or, etc.).

    All claims can be converted into ScalaCheck Prop values. (The reverse is not true -- it's not possible to extra ScalaCheck labels from a Prop without running it.)

  2. trait LowPriorityRenderInstances extends AnyRef

    Low-priority fallback that uses toString.

    Low-priority fallback that uses toString.

    If a type uses this Render instance, it breaks the ability of Render to recursively display any of its member values, even those that have Render instances.

  3. trait Render[A] extends AnyRef

    Render is a typeclass to provide human-readable representations of values.

    Render is a typeclass to provide human-readable representations of values.

    This typeclass provides two major concrete benefits over the built-in toString method:

    1. We get better representations of some built-in types. For example, Strings are quoted, Arrays are handled like other collections, and so on.

    2. Authors can override representations locally to improve error reporting in their own tests.

    Claimant attempts to provide instances for most built-in Scala types, as well as a handy macro for generating instances for Scala case classes. For example, the following code produces a Render[Rectangle] value, which will use Render[Double] instances recursively:

    case class Rectangle(height: Double, width: Double)

    object Rectangle { implicit renderForRectangle: Render[Rectangle] = Render.caseClass[Rectangle] }

    This typeclass is very similar to cats.Show (and probably others). One major design difference is that for a given type T, if a specific Render[T] is not available, this typeclass will generate an instance that just uses .toString. This behavior is intended to balance the benefits of custom representations with not requiring authors to write a bunch of new code in order ot use Claimant.

  4. abstract class RenderInstances extends RenderTupleInstances with LowPriorityRenderInstances
  5. abstract class RenderTupleInstances extends AnyRef
  6. trait Scribe extends AnyRef

    Scribe represents a set of strategies for annotating expressions to produce more interesting String representations.

    Scribe represents a set of strategies for annotating expressions to produce more interesting String representations.

    The annotate method should return None in cases where the expression shape is not recognized. It is given a reference to the System because annotation might be recursive. (Currently recursive annotations are not used due to the complexity of displaying that information.)

    The trees that result from annotate must be String expressions.

  7. abstract class System extends AnyRef

    System encapsulates the strategies used by Claimant.

    System encapsulates the strategies used by Claimant.

    Tinkers describe how to decompose Boolean expressions, and scribes describe how to label _any_ expression. Together we use them to build labels for labeled Prop values.

  8. trait Tinker extends AnyRef

    Tinker represents a set of strategies for deconstructing Boolean expressions into Claims (the deconstruct method).

    Tinker represents a set of strategies for deconstructing Boolean expressions into Claims (the deconstruct method).

    The deconstruct method should return None in cases where the expression shape is not recognized. It is given a reference to the System because deconstruction is often recursive -- for example, deconstructing (x && y) may involve deconstructing x and deconstructing y independently.

    Only c.Expr[Boolean] expressions can be deconstructed. A different process (annotation) is used to create labels -- see Scribe for more information.

Value Members

  1. object Claim
  2. object Format

    Format provides supports building trees of different shapes with quasiquotes.

    Format provides supports building trees of different shapes with quasiquotes.

    The trees don't represent actual expressions, but rather represent String expressions involving concatenation of other Strings and String expressions.

    These methods will also annotate the String with an optional value (representing the result of the expression).

  3. object Render extends RenderInstances
  4. object System

Ungrouped