ruby / spec

The Ruby Spec Suite aka ruby/spec
MIT License
600 stars 388 forks source link

Improve checks for actual duration in sleep specs #1213

Closed herwinw closed 2 weeks ago

herwinw commented 2 weeks ago

Use should < instead of trying to match the boolean itself. This way, the output on failures show the actual duration instead of just a true/false error.

Example error message with this change:

Expected 0.15368436999779078 < 0.03

Just happened to spot this in #1212. I'm leaving this as draft for now, to prevent it from clashing with those changes.

eregon commented 2 weeks ago

Let's close, it doesn't even pass reliably on Linux and the spec needs to be reworked

headius commented 2 weeks ago

Weirdly enough I did not think this worked. Thanks for the help!