disu.se

LookoutModule

Namespace

Top-level Namespace

Main namespace of the Lookout library.

Expectations is the main entry point to the library, representing the “Expectations” keyword in expectation files and allowing such files to be loaded, enumerating the Expect blocks found in such files. Each such block has an Expected value that’s an Actual result wrapper, a Literal, an expected Output, an expected Warning, an expected method Reception, or any ::Object really, which it’ll compare to the actual result of executing the block, reporting any Differences – which may, in turn, be shown as Diffs – as its Result.

To help out, stub and mock objects may be created. Furthermore, all ::Objects have been extended to support easy creation of expected method Receptions, using a simple domain-specific language that uses Aphonic receivers to gather the necessary information.

To avoid failing while trying to report failures, non-failing access to Exceptions and Inspections of objects is used, as well as making sure to Encode any output properly.

There’s a command-line interface defined in Interfaces::Commandline that can be used by other interfaces that want to invoke Lookout on a set of files. It’s used by the Lookout-Rake library.

Plugins should place their namespace under the Lookout::Plugins namespace.

Children

Actual

Stands in for the actual result of the expect block, allowing a query method to call on the actual result to be set up and checked after the expect block returns.

Aphonic

Class that only responds to #__send__ and #object_id.

Diff

Namespace for the “diff” subsystem.

Difference

Function-like namespace for type-specific difference reports.

Encode

Encodes objects as UTF-8-encoded Strings.

Exception

Provides non-failing access to some of ::Exception’s methods.

Expect

Function-like namespace for type-specific expect blocks.

Expectations

Represents the “Expectations” keyword in expectation files and the expectation files themselves.

Expected

Function-like namespace for type-specific expected values.

Inspect

Non-failing inspection of objects.

Interfaces

Namespace for interfaces to Lookout.

Literal

Proxies objects that should be literally expected.

Mock

Object that doesn’t respond to anything except for what’s been explicitly defined on it and throws a mock error whenever it receives a method call.

Object

Namespace for extensions to ::Object.

Output

Output expectation proxy.

Plugins

Namespace for Lookout plugins.

Reception

Method reception expectation builder.

Result

Base module for Results.

Results

Namespace for Result types.

Stub

Object that only responds to a given set of methods and returns itself whenever it receives a method call it doesn’t know anything about.

Warning

Warning expectation proxy.