disu.se

ObjectClass

Namespace

Lookout::Difference

Ancestors
  1. Object

Subclasses
Array

Difference reports between ::Arrays.

Exception

Difference reports between ::Exceptions.

Hash

Difference reports between ::Hashes.

Method

Difference reports between ::Lookout::Actual::Methods.

Output

Difference reports between ::Lookout::Outputs.

Module

Difference reports between ::Modules.

Range

Difference reports between ::Ranges.

Regexp

Difference reports between ::Regexps.

String

Difference reports between ::Strings.

Symbol

Difference reports between ::Symbols.

Difference reports between ::Objects. This is the base difference report class and should be subclassed if something more specific fits the bill. The actual result and expected value are assumed to differ and you’ll surely get confused if they don’t. Determining if the objects differ is up to the caller.

Constructor

initialize(actual::Object, expected::Object)#

Initializes a difference report between the actual result and the expected value.

Instance Methods

message::String#

Returns the concatenation of #inspect_actual, #symbol, and #inspect_expected, explaining how #actual differs from #expected.

Note

Subclasses may override this method to provide more specific messages for their specific types.

diffEnumerable<String>#

Returns an Enumerable over the formatted operations that would have to be applied to #actual to get #expected.

Note

The Enumerable returned by this specific implementation is empty. Subclasses may provide more detailed information for their specific types.

to_s::String#

Returns the concatenation of #message and #diff.

Note

This method should not be overridden by subclasses, as it goes to some lengths to safely return a String for display.

==(otherObject)Boolean#

Returns true if the receiver’s class, #message, and #diff equal those of other.

hashInteger#

Returns a hash value based on #message and #diff.

inspect_actual::Stringprivate#

Returns the safely inspected value of #actual, see Inspect.

inspect_expected::Stringprivate#

Returns the safely inspected value of #expected, see Inspect.

symbol::Stringprivate#

Returns the inequality symbol to use (‘≠’).

actual::Object#

Returns the actual result.

expected::Object#

Returns the expected value.