Live data from Hacker News

Spec-me-maybe: Introduces the “maybe” syntax to RSpec

github.com

21–30 of 42 posts

Re: Spec-me-maybe: Introduces the “maybe” syntax to RSpec

#22
post #8

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.

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

Re: Spec-me-maybe: Introduces the “maybe” syntax to RSpec

#23

Earlier quoted context omitted.

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.

Re: Spec-me-maybe: Introduces the “maybe” syntax to RSpec

#29

I find it quite funny that people cannot tell whether this is a joke or not, just says something about the state of things...

It does; considering situations where this would be seen as a realistic/novel approach for fixing flapping tests. No need to examine root cause! sigh

Re: Spec-me-maybe: Introduces the “maybe” syntax to RSpec

#30

I can see wondering if this was a joke as 'maybe' is mildly reminiscent of promise[1] and the like but if you got to .on_my_machine and still couldn't figure it out, you got some 'splainin to do. :) [1] http://blogs.msdn.com/b/ie/archive/2011/09/11/asynchronous-p...

There's also the Maybe monad, which is a good substitute for null.
Post reply on HN