Two words you need to know

marick edited this page Jan 16, 2013 · 2 revisions
Clone this wiki locally

Midje uses "fact" in the way other frameworks use "test", and "check" in the way other frameworks use "assertion". Here's a fact with two checks:

(fact "both addition and multiplication have a unit element"
   (+ 5 0) => 5
   (* 5 1) => 5)

So here we have a general claim of a fact about the world of mathematics, which we could also write as ∀x: x+0=x, x×1=x. Since we can't actually check whether that fact is true for all numbers, we make two more modest and specific claims. Midje will check them for us. We think that if those easier claims check out, we're justified in believing the bigger claim about a fact of arithmetic. (Well, we would be, if we knew less about computers, arithmetic overflow, limits to physical memory, and things like that.)

In addition to "fact" and "check", there are other important words like checker and prerequisite, but those won't be needed just yet.