com.wix.accord

scalatest

package scalatest

Visibility
  1. Public
  2. All

Type Members

  1. trait CombinatorTestSpec extends WordSpec with Matchers with ResultMatchers

    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 WordSpec 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

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

Ungrouped