Displaying 1 result from an estimated 1 matches for "some_expensive_operation".
2009 Jul 09
3
before(:all) and nested contexts
...my question is, is there any workaround for successfully using
> before(:all) and nested specs, so that code like the following works and
> doesn''t run the expensive operation more than once:
> describe "Some functionality" do
> ??before(:all) do
> ?? ?@variable = some_expensive_operation
> ??end
>
> ??it "should do something" do
> ?? ?@variable.should do_something
> ??end
>
> ??describe "in a specific context" do
> ?? ?it "should do another thing" do
> ?? ? ?@variable.should do_another_thing
> ?? ?end
> ??end
> end
&...