Skip to content
trans edited this page Sep 13, 2010 · 2 revisions

As with any test framework, Q.E.D. also requires a means of making assertions. Q.E.D. uses Assertive Expressive (A.E.) for its assertion syntax. A.E. is a nice system. It does not enforce a strict behavior-focused or test-focused nomenclature, but largely leaves it to the developer and the test case at hand. By supporting the more diversified and object-oriented set of “say-it-is-so” methods of A.E., Q.E.D. maximizes the descriptive suitability to the real requirements. For example, the following statements are all equally supported and logically equivalent.

      5.expect == 5
      5.assert == 5
      5.should == 5

Each of these methods operate uniformly as functors, but vary in their other uses according to their respective concepts. For instance expect can be used to specify an error will be raised.

      expect NoMethodError do
        what?
      end

While blocks to assert ensure truth.

      assert do
        4 == 4
      end

Please follow the A.E. link to lean more about it’s system of assertion.

Q.E.D. does not depend on any specific mocking library. You are free to use your preferred system. If you are in the market of a mock library, have a look at Sim, while still under development, it looks promising as it seeks to avoid some of the pitfalls of traditional mocks.

Clone this wiki locally