Lemon is a unit testing framework which enforces highly formal case-to-class and unit-to-method test construction. This strict approach is arguably a more proper technique for unit testing because it helps focus concern on individual units of behavior and thus helps promote good test coverage. This is unlike functional and integration testing which rightly focus on more holistic issues.

Example

To give you a taste of what a lemon testcase looks like, let's say we have a library that consists of the class HelloWorld with method #to_s:

  class HelloWorld
    def to_s
      "Hello, World!"
    end
  end

We would write a Lemon test case along the following lines:

  TestCase HelloWorld do
    Concern "String output works as expected."

    Unit :to_s do
      Test "returns a string" do
        HelloWorld.new.to_s.assert.is_a?(String)
      end

      Test "returns a 13 character phrase" do
        HelloWorld.new.to_s.size.assert == 13
      end
    end
  end

A silly example to be sure, but one we can all easily understand.