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

aslak hellesoy aslak.hellesoy at gmail.com
Mon Sep 4 10:34:13 EDT 2006


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
>


More information about the Rspec-users mailing list