All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.pawelkrol.CommTest.ChangeValidator.scala Maven / Gradle / Ivy

There is a newer version: 0.05
Show newest version
package com.github.pawelkrol.CommTest

class ChangeValidator[T](code: () => Any, predicate: () => T) {

  def from(initial: => T) = FromToValidator(code, predicate, () => initial)

  def to(value: => T) = {
    code()
    val ending = predicate()
    assert(ending == value, "expected change to '%s', but it changed to '%s'".format(value, ending))
  }
}

object ChangeValidator {

  def apply[T](code: () => Any, predicate: () => T) = new ChangeValidator(code, predicate)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy