Skip to content

Instantly share code, notes, and snippets.

View AntonErmolenko's full-sized avatar

Anton Ermolenko AntonErmolenko

View GitHub Profile
@AntonErmolenko
AntonErmolenko / factory_doctor.rb
Last active June 10, 2021 10:05 — forked from palkan/factory_doctor.rb
FactoryDoc: detect useless data generation in tests
# frozen_string_literal: true
module FactoryBot
module Doctor
module FloatDuration
refine Float do
def duration
t = self
format("%02d:%02d.%03d", t / 60, t % 60, t.modulo(1) * 1000)
end