For deterministic functions/methods, the same set of inputs should always produces the same output. What about adding something like: assert_follows_spec(method_or_class_name, spec) Where spec is an array of input and output pairs (and optionally an exception, if the input should not be accepted): [{input => [1, 1, 1], output => 1}, {input => [8, 1, 2], output => 4}, {input => [8, 3, 4], output => 6}, {input => [4, 3, 2], output => 6}, {input => [1, 2, nil], exception => ArgumentError}, {input => [1, 2, 0], exception => ZeroDivisionError}] This can make unit tests shorter and more readable. We can transform the spec into an HTML table, include it into the API documentation, etc. The assert_follows_spec() could even perform several iterations of tests if wanted, to test deterministic-ness. -- dave