[Rspec-users] RSpec style in Scriptaculous' unittest.js

Jason Anderson thenewjhp at gmail.com
Mon Sep 4 04:47:11 EDT 2006


I can't help noticing a bit of code that I keep repeating.

I find myself writing things like:

specify "should be empty" do

Instead, suppose rspec captured and stored the result of setup() and
used that value automatically if specify() is called without a block?
Here's how it might look, using the example from the rspec page:

context "BDD framework" do

 setup do
   BddFramework.new  # value stored by rspec

 specify "should be adopted quickly"
 specify "should be intuitive"


Lovely, no?


Jason Anderson
thenewjhp at gmail.com

More information about the Rspec-users mailing list