Follow

Here's a no-fuss way to mock `rand` in your specs:

allow_any_instance_of(Object).to receive(:rand).and_return(5)

Sign in to participate in the conversation
Ruby.social

A Mastodon instance for Rubyists & friends