[rspec-users] RSpec vs Screw.Unit

Scott Taylor mailing_lists at railsnewbie.com
Fri Oct 17 01:44:59 EDT 2008

On Oct 16, 2008, at 4:28 PM, Ashley Moran wrote:

> Hi
> Hope this isn't OT.  I'm currently contemplating using the Dojo[1]  
> JavaScript framework, and I suspect it's powerful enough that using  
> Cucumber features and Celerity alone will quickly leave me wanting  
> lower-level unit specs for the JS.
> So I just wondered if anyone here has used Screw.Unit[2], and if so,  
> how does it compare to RSpec?  It seems to offer many of the  
> features of RSpec (with the notable exception of shared behaviours).

I've been using it a bunch, and I must say that so far I've really  
enjoyed it.  Here are the downsides that I've noticed:

1.  It's much more verbose,  and doesn't read quite as cleanly as  
rspec.  Instead of foo.should == "bar", you'll end up with:

expect(foo()).to(equal, bar());

Which just gets a bit syntax heavy.  I'm sure that they didn't want to  
polute the global namespace, but maybe a function like this might  
solve the problem:

Object.prototype.should = function(obj) {
	expect(this).to(equal, arg);

2. The matchers just aren't there the way they are for rspec.  This  
can make a big difference to code readability.  Obviously, you could  
build them yourself. (This is just a matter of time, and standing on  
the shoulders of giants sort of thing).

3.  I haven't looked very hard, but I haven't found a plain text  
runner yet.  Obviously it's going to need a browser if you're planning  
on doing DOM interaction (which is very easy).  For me, though, a  
plain text runner would be awsome.


> Thanks
> Ashley
> [1] http://dojotoolkit.org/
> [2] http://github.com/nkallen/screw-unit/tree/master
> -- 
> http://www.patchspace.co.uk/
> http://aviewfromafar.net/
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list