Class | Buildr::Checks::Expectation |
In: |
lib/buildr/core/checks.rb
(CVS)
|
Parent: | Object |
An expectation has subject, description and block. The expectation is validated by running the block, and can access the subject from the method it. The description is used for reporting.
The expectation is run by calling run_against. You can share expectations by running them against different projects (or any other context for that matter).
If the subject is missing, it is set to the argument of run_against, typically the project itself. If the description is missing, it is set from the project. If the block is missing, the default behavior prints "Pending" followed by the description. You can use this to write place holders and fill them later.
block | [R] | |
description | [R] | |
subject | [R] |
First argument is subject (returned from it method), second argument is description. If you omit the description, it will be set from the subject. If you omit the subject, it will be set from the object passed to run_against.
Runs this expectation against the context object. The context object is different from the subject, but used as the subject if no subject specified (i.e. returned from the it method).
This method creates a new context object modeled after the context argument, but a separate object used strictly for running this expectation, and used only once. The context object will pass methods to the context argument, so you can call any method, e.g. package(:jar).
It also adds all matchers defined in Buildr and RSpec, and two additional methods: