Skip to content

Instantly share code, notes, and snippets.

View pdbradley's full-sized avatar

Philip Bradley pdbradley

View GitHub Profile
@pdbradley
pdbradley / factory_doctor.rb
Created March 9, 2023 20:28 — forked from palkan/factory_doctor.rb
FactoryDoc: detect useless data generation in tests
module FactoryGirl
module Doctor
module FloatDuration
refine Float do
def duration
t = self
format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000)
end
end
end