TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

99 点作者 speric超过 10 年前

12 条评论

ZirconCode超过 10 年前
I find it quite funny that people cannot tell whether this is a joke or not, just says something about the state of things...
评论 #8372888 未加载
评论 #8373637 未加载
评论 #8373469 未加载
jxf超过 10 年前
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.
评论 #8372924 未加载
ubertaco超过 10 年前
Love the build status badge. Nice touch.
评论 #8373674 未加载
tvon超过 10 年前
Everything should also take `.maybe.it_wont` at the end, for completeness.
评论 #8373323 未加载
shittyanalogy超过 10 年前
I can see wondering if this was a joke as &#x27;maybe&#x27; is mildly reminiscent of promise[1] and the like but if you got to .on_my_machine and still couldn&#x27;t figure it out, you got some &#x27;splainin to do. :)<p>[1] <a href="http://blogs.msdn.com/b/ie/archive/2011/09/11/asynchronous-programming-in-javascript-with-promises.aspx" rel="nofollow">http:&#x2F;&#x2F;blogs.msdn.com&#x2F;b&#x2F;ie&#x2F;archive&#x2F;2011&#x2F;09&#x2F;11&#x2F;asynchronous-p...</a>
评论 #8373477 未加载
bryanlarsen超过 10 年前
This may be a joke, but there are valid scenarios for this sort of thing, which is why rspec has pending and skipped tests:<p><a href="https://relishapp.com/rspec/rspec-core/v/3-1/docs/pending-and-skipped-examples" rel="nofollow">https:&#x2F;&#x2F;relishapp.com&#x2F;rspec&#x2F;rspec-core&#x2F;v&#x2F;3-1&#x2F;docs&#x2F;pending-an...</a>
评论 #8373093 未加载
harrylove超过 10 年前
<p><pre><code> it &#x27;probably should not raise any sort of error&#x27; do maybe { user }.will_not raise_error end </code></pre> I snorted on that one.
thekylemontag超过 10 年前
maybe(test).will be_success.on_my_machine<p>I can’t stop laughing right now. Well done boys, well done.
adamors超过 10 年前
This is really funny, thanks for sharing.
artursapek超过 10 年前
The epitome of programming in Ruby.
评论 #8372909 未加载
jordanwallwork超过 10 年前
Is this serious or a joke? If its serious I seems like a bloody awful idea!! What is the point of a maybe test??
rubiquity超过 10 年前
This has to be a joke. I&#x27;m fond of TDD just as much as the next person, but seriously, some of you RSpec fanatics have lost your minds.
评论 #8372940 未加载
评论 #8373112 未加载
评论 #8372866 未加载