SusSourceSusReceiveWithOptions

class WithOptions

Represents a constraint on method call keyword options.

Definitions

def initialize(predicate)

Initialize a new WithOptions constraint.

Signature

parameter predicate Object

The predicate to match against options.

Implementation

def initialize(predicate)
	@predicate = predicate
end

def print(output)

Print a representation of this constraint.

Signature

parameter output Output

The output target.

Implementation

def print(output)
	output.write("with options ", @predicate)
end

def call(assertions, subject)

Evaluate this constraint against options.

Signature

parameter assertions Assertions

The assertions instance to use.

parameter subject Hash

The options to check.

Implementation

def call(assertions, subject)
	assertions.nested(self) do |assertions|
		Expect.new(assertions, subject).to(@predicate)
	end
end