Package

com.wix.accord

scalatest

Permalink

package scalatest

Visibility
  1. Public
  2. All

Type Members

  1. trait CombinatorTestSpec extends AnyWordSpec with Matchers with ResultMatchers

    Permalink

    An opinionated helper trait for combinator specifications.

    An opinionated helper trait for combinator specifications. The recommended practice for defining new combinators is test-first via this specification:

    class MyCombinatorSpec extends AnyWordSpec with ResultMatchers with Matchers {
    
      def isMonotonous[ T ]: Validator[ Iterable[ T ] ] = ???
    
      "isMonotonous" should {
        "successfully validate a monotonously-increasing sequence of numbers" in {
          isMonotonous( Seq( 1, 2, 3, 4, 5 ) ) should be( aSuccess )
        }
    
        "correctly render violations on a random sequence" in {
          isMonotonous( Seq( 5, 4, 3, 2, 1 ) ) should failWith( "is not monotonously-increasing" )
        }
      }
    
    }
  2. trait ResultMatchers extends AnyRef

    Permalink

    Extends a test suite with a set of matchers over validation com.wix.accord.Results.

Ungrouped