Sus::Fixtures::Time SourceSusFixturesTimeMeasuredContext

module MeasuredContext

A context for comparing measured durations, taking into account the overhead (quantum) of the system.

Definitions

def be_measured_faster_than(duration)

The measured duration is less than the given duration plus the quantum.

Signature

parameter duration Numeric

The expected duration.

Implementation

def be_measured_faster_than(duration)
	be < (duration + QUANTUM)
end

def be_measured_slower_than(duration)

The measured duration is greater than the given duration minus the quantum.

Signature

parameter duration Numeric

The expected duration.

Implementation

def be_measured_slower_than(duration)
	be > (duration - QUANTUM)
end

def be_measured_within(duration)

The measured duration is within the given duration plus or minus the quantum.

Signature

parameter duration Numeric

The expected duration.

Implementation

def be_measured_within(duration)
	be_within(QUANTUM).of(duration)
end