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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Spectacular: a BDD framework for CoffeeScript and JavaScript inspired by RSpec

25 点作者 Pym将近 12 年前

7 条评论

stiff将近 12 年前
I was an early adopter of RSpec, have been using it for years now, and I came to think it&#x27;s not worth it. More generally, mimicking natural language with a programming language DSL seems like a very bad idea. It seems nice that the tests look like a specification in english, but it is a one way correspondence, then you start to write things that look like they should work because they reassemble an english sentence but they don&#x27;t really work because of the limitations of semantics of the programming language; moreover those can fail silently or work in ways other than expected. And this is so after the RSpec guys inserted all this rocket-science to make the DSL as elaborate as possible, in the process often introducing tricky bugs because the code for accomplishing this is so complex.<p>Since there are no tests for tests, tests should be written in really the simplest possible way. The principal goal of a test framework should be simplicity, reproducibility and reliability. In the end non-programmers anyway don&#x27;t read the &quot;specs&quot; unless you are living in a fantasy world of the TDD gurus.
评论 #6057675 未加载
评论 #6057998 未加载
评论 #6057742 未加载
paldepind2将近 12 年前
So I get that I can do the following with Spectacular<p><pre><code> itsInstance &#x27;length&#x27;, -&gt; should equal 0 </code></pre> Instead of what I can currently do with Mocha+Chai.js<p><pre><code> item.length.should.equal 0 </code></pre> But besides the different syntax (which doesn&#x27;t matter to me) what does this framework offer me that Mocha+Chai.js doesn&#x27;t?<p>Btw. the above is an honest genuine question. I&#x27;m not questioning that the framework has something to offer I just can&#x27;t figure out what it is from reading the website (the DOM features doesn&#x27;t mean anything to me since I&#x27;m currently writing tests for a library).
评论 #6057070 未加载
EzGraphs将近 12 年前
Does this provide any advantages over Jasmine for JavaScript BDD called by Karma (formerly Testacular) as the Test Runner?<p><a href="http://pivotal.github.io/jasmine/" rel="nofollow">http:&#x2F;&#x2F;pivotal.github.io&#x2F;jasmine&#x2F;</a><p><a href="http://karma-runner.github.io/0.8/index.html" rel="nofollow">http:&#x2F;&#x2F;karma-runner.github.io&#x2F;0.8&#x2F;index.html</a>
评论 #6057056 未加载
评论 #6056814 未加载
davedx将近 12 年前
I like the async test handling better than Jasmine. It&#x27;s the first thing I look for in testing frameworks nowadays.<p>I&#x27;m working on a simple lightweight framework at the moment that&#x27;s designed to run on browsers in target environments such as VMs or cloud browsers, and a lot of my code deals with async issues.<p>Moving to a promise-based system is definitely something I&#x27;m considering investigating.<p>One pet peeve I have with all of these test frameworks though is the &quot;kitchen sink&quot; approach: there is always a substantial list of features. This led to me to roll my own.
angerman将近 12 年前
It does look interesting indeed.<p>I also like the design and layout of the site.<p>BUT: Does the &quot;Download&quot; button behave weird for anyone else as well? It&#x27;s quite slow, not really responsive, and at the same time pushes the content below the button downwards&#x2F;upwards depending on state (might be part of being slow). [Safari on OS X]<p>edit: I&#x27;m referring to the download button here: <a href="http://abe33.github.io/spectacular/#Browser" rel="nofollow">http:&#x2F;&#x2F;abe33.github.io&#x2F;spectacular&#x2F;#Browser</a>
评论 #6057058 未加载
Jacob4u2将近 12 年前
Seems like the author combined the spec side of mocha with should.js and a stub&#x2F;mocking library, focused it on node and polished it up with some neat conventions and utilities.<p>I&#x27;ll probably give it a shot on my next project. I&#x27;m interested in finding out if it went the route of throwing exceptions for error reporting like mocha, or something else.
评论 #6058061 未加载
dubcanada将近 12 年前
I&#x27;m really not a fan of having the options on window.options. Not only is that weirdly populating the window object with single use options. It also is extremely not targeted. At least it should be window.something.options.
评论 #6058680 未加载