Class RushCheck::Assertion
In: rushcheck/assertion.rb
Parent: Object

Assertion class is one of main features of RushCheck. You can write a testcase for random testing as follows:

Assertion.new(Integer, String) do |x, y|

  RushCheck::guard { precondition }
  body

end

The return value of the body of testcase is checked by the method ‘check’.

Note that the number of arguments in the block must be equal to the number of arguments of Assertion.new. However, for a curried block, we can write also

  Assertion.new(*cs) {|*xs| ...}

See also class Claim, which is a subclass of Assertion See also the RushCheck tutorial and several examples.

Methods

new   property  

Included Modules

RushCheck::Testable

Public Class methods

Public Instance methods

[Validate]