Hacker News new | ask | show | jobs
by jxf 4283 days ago
While this is obviously a joke, I can see it having a limited amount of practical value. Imagine, for example, being tasked with updating a poorly-maintained legacy code base with a large number of indeterminately failing specs containing order dependencies. You could `RSpec::Maybe` everything until you're sure you have the order dependencies resolved, then convert to regular `RSpec::Expectation`s.
1 comments

That's the usecase of `pending`
pending might as well not be there.

how many maybes passed could be useful information - perhaps 80% is good enough to be confident it works, but if it's 20% something's gone wrong

Pending is really useful: it can also tell you if a test that you expected to be passing is now failing. It's also useful for hiding output for tests that are temporarily failing, until you fix them all.

I'll often spec out a whole behavior, with ten or fifteen tests, and then mark all but one pending, make that one pass, unmark another one, make that pass, unmark another... it's easier to focus on just the one you're working on rather than 19 other failing outputs.

Committing a pending test? yeah, that's bad.