[rspec-users] Is share_examples_for deprecated?

David Chelimsky dchelimsky at gmail.com
Sun Mar 7 07:43:47 EST 2010

On Sat, Mar 6, 2010 at 10:21 PM, Nick Hoffman <lists at ruby-forum.com> wrote:
> Pat Maddox wrote:
>> describe "something something", :shared => true do
>>   ...
>> end
>> describe "chunky bacon" do
>>   it_should_behave_like "something something"
>> end
> BTW, is rspec.info supposed to be up-to-date? It still recommends using
> "shared_examples_for".
> http://rspec.info/documentation/

So this presents an interesting problem :)

My intent some time back was to deprecate :shared => true, not
share_examples_for (which is aliased with shared_examples_for). Based
on that, the rspec.info site is correct and Pat is incorrect. However,
Pat didn't know that because I never communicated it in any other way
besides documenting the method on the site.

Now as we're introducing rspec-2 to the mix, option hashes passed to
describe and it will become much more common. On the grounds that it
would simplify the API, it seems to me it might make more sense in
rspec-2 to use :shared => true and get rid of these methods.



More information about the rspec-users mailing list