[rspec-users] Application-wide spec_helper method
dchelimsky at gmail.com
Thu Aug 28 13:57:48 EDT 2008
On Thu, Aug 28, 2008 at 12:27 PM, Zach Dennis <zach.dennis at gmail.com> wrote:
> You can put it in a module and include it for model specs in spec_helper.rb
> Spec::Runner.configure do |config|
> # ...
> config.include DescribeModelAttributeSpecHelper, :type => :model
What he said.
> On Thu, Aug 28, 2008 at 12:41 PM, Nick Hoffman <nick at deadorange.com> wrote:
>> On 2008-08-28, at 08:02, David Chelimsky wrote:
>>> On Wed, Aug 27, 2008 at 2:38 PM, Nick Hoffman <nick at deadorange.com> wrote:
>>>> If a helper method can be used for multiple model specs, obviously it
>>>> not be placed within a specific model's spec helper file. Is there a
>>>> recommended file in which to put such a method? Maybe
>>>> spec/helpers/application_helper_spec.rb ?
>>> This is a very confusing question. Model's don't typically get
>>> individual spec helper files, so I'm not sure what you're getting at.
>>> Can you give an example?
>> I asked because I had begun to abstract my #describe_properties method away
>> from the Property model so that it can be used with any model. Now that the
>> method's been converted from this:
>> to this:
>> I'd like to use it with multiple models.
>> rspec-users mailing list
>> rspec-users at rubyforge.org
> Zach Dennis
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users