[rspec-users] spec'ing the existence of #require
Chuck Remes
cremes.devlist at mac.com
Sun Aug 31 22:27:21 EDT 2008
On Aug 31, 2008, at 2:58 PM, David Chelimsky wrote:
> On Sun, Aug 31, 2008 at 2:38 PM, Chuck Remes
> <cremes.devlist at mac.com> wrote:
>>
>> On Aug 31, 2008, at 12:42 PM, Scott Taylor wrote:
>>
>>>
>>> On Aug 31, 2008, at 10:36 AM, Chuck Remes wrote:
>>>
>>>> I looked through the mailing list archive but unfortunately my
>>>> search
>>>> terms are too generic (spec and require...).
>>>>
>>>> I am writing ruby code that runs under jruby in an embedded
>>>> environment.
>>>> Periodically I will install new code that passes all specs only
>>>> to have it
>>>> fail when it can't find a new class I defined (missing #require).
>>>>
>>>> My spec_helper.rb file does a wildcard search and loads all rb
>>>> files in
>>>> the tree,
>>>
>>> Why? Why don't you just have it load lib/your_project_name.rb,
>>> which
>>> requires everything else?
>>
>> I don't know. Is that the right way to do it? The way I am doing it
>> now
>> mimics how the rspec gem includes all of the rspec files for testing,
>
> It does? What I see is that the spec files all include spec_helper.rb,
> which, in turn, adds lib to the path and then requires 'spec'. What
> are you thinking of when you say the gem includes all the files for
> testing?
<sigh> You are right. That is *not* what rspec does. I know I copied
this from some major gem that used rspec but now I can't find it. I
retract what I said about rspec including everything (via the
spec_helper.rb).
I'll try creating a single file that #requires everything I need and
see if that accomplishes all I need. Thanks for the tips.
cr
More information about the rspec-users
mailing list