class

KemalIdentity::Testing::TestClock

Inherits KemalIdentity::Clock < Reference < Object

A clock that only moves when a spec moves it.

This is what makes expiry testable at all: asserting that a session expires after twelve hours advances the clock rather than sleeping. Passes the same Clock contract spec as SystemClock.

Constructors

new(now : Time = Time.utc(2026, 8, 24, 12, 0, 0))
Source

Instance methods

advance(span : Time::Span) : Time

Move forward. Time never runs backwards on its own, so this is the only mutator, and it refuses a negative span rather than quietly rewinding.

Source
now

The current instant, always UTC.

Source
travel_to(time : Time) : Time

Jump to an arbitrary instant. For setting up a fixture, not for simulating the passage of time — use advance for that.

Source