aslak hellesoy
2006-Aug-31 10:00 UTC
[Rspec-users] RSpec style in Scriptaculous'' unittest.js
Doing Javascript? Looks like Scriptaculous'' *excellent* unittest.js has got some BDD love: http://ajaxian.com/archives/scriptaculous-behaviour-driven-development-testing Aslak
Jason Anderson
2006-Sep-04 08:47 UTC
[Rspec-users] RSpec style in Scriptaculous'' unittest.js
All, I can''t help noticing a bit of code that I keep repeating. I find myself writing things like: specify "should be empty" do @stack.should_be_empty end 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 end specify "should be adopted quickly" specify "should be intuitive" end Lovely, no? Best, Jason Anderson thenewjhp at gmail.com
aslak hellesoy
2006-Sep-04 14:34 UTC
[Rspec-users] RSpec style in Scriptaculous'' unittest.js
On 9/4/06, Jason Anderson <thenewjhp at gmail.com> wrote:> All, > > I can''t help noticing a bit of code that I keep repeating. >When starting a new topic, please don''t reply to an existing mail.> I find myself writing things like: > > specify "should be empty" do > @stack.should_be_empty > end > > 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 > end > > specify "should be adopted quickly" > specify "should be intuitive" > > end > > Lovely, no? >Interesting approach to getting rid of duplication! Please submit a feature request at Rubyforge. Or better - a patch. Aslak> > Best, > > Jason Anderson > thenewjhp at gmail.com > _______________________________________________ > Rspec-users mailing list > Rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >