[rspec-users] Is share_examples_for deprecated?
lists at ruby-forum.com
Sun Mar 7 09:59:25 EST 2010
David Chelimsky wrote:
> 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.
I'm a fan of "shared_examples_for", because it's beautifully descriptive
of what the purpose of its block is: sharing its examples with other
Passing ":shared => true" to a "describe" is less obvious to me, simply
because it doesn't stand out. This is especially true when ":shared =>
true" is at the end of a long string. Eg: http://pastie.org/858196
Posted via http://www.ruby-forum.com/.
More information about the rspec-users