[rspec-users] RSpec vs Screw.Unit

Joseph Wilk josephwilk at joesniff.co.uk
Fri Oct 17 10:54:15 EDT 2008


On of the things I've noticed with ScrewUnit is to quote the ScrewUnit wiki:

"The dynamic nature of JavaScript makes mocking frameworks mostly 
unnecessary"

A small but interesting difference from using Ruby, Rspec and its 
built-in mocking framework.

--
Joseph Wilk
http://www.joesniff.co.uk





Scott Taylor wrote:
>
> 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.
>
> Scott
>
>
>>
>>
>> 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
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



More information about the rspec-users mailing list