Module Buildr::Checks
In: lib/buildr/core/checks.rb  (CVS)

Methods added to Project to allow checking the build.

Methods

Included Modules

Extension

Classes and Modules

Class Buildr::Checks::Expectation

Public Instance methods

Adds an expectation. The expectation is run against the project by the check task, executed after packaging. You can access any package created by the project.

An expectation is written using a subject, description and block to validate the expectation. For example:

For example:

  check package(:jar), "should exist" do
    it.should exist
  end
  check package(:jar), "should contain a manifest" do
    it.should contain("META-INF/MANIFEST.MF")
  end
  check package(:jar).path("com/acme"), "should contain classes" do
    it.should_not be_empty
  end
  check package(:jar).entry("META-INF/MANIFEST"), "should be a recent license" do
    it.should contain(/Copyright (C) 2007/)
  end

If you omit the subject, the project is used as the subject. If you omit the description, the subject is used as description.

During development you can write placeholder expectations by omitting the block. This will simply report the expectation as pending.

[Validate]