module Cucumber::Core::Filter

Filters process test cases.

Each filter must respond to the following protocol:

* `with_receiver(new_receiver)`
* `test_case(test_case, &describe_test_steps)`
* `done`

The ‘with_receiver` method is used to assemble the filters into a chain. It should return a new instance of the filter with the receiver attribute set to the new receiver. The receiver will also respond to the filter protocol.

When a ‘test_case` message is received, the filter can choose to:

  1. pass the test_case directly to its receiver (no-op)

  2. pass a modified copy of the test_case to its receiver

  3. not pass the test_case to its receiver at all

Finally, the ‘done` message is sent. A filter should pass this message directly to its receiver.