Rake spec fails where rake spec:(models|controllers|views) pass

I’m still trying to work into Ruby 1.9.2 and am now experiencing
something that makes no sense to me. Using rspec 1.3.2 and rspec-rails
1.3.4 with rails 2.3.11 on ruby 1.9.2-p180, when I

$ rake spec:models

they all pass. When I

$ rake spec:controllers

they all pass. When I

$ rake spec:views

they all pass. But when I

$ rake spec

I get

/activesupport-2.3.11/lib/active_support/dependencies.rb:177: stack
level too deep (SystemStackError)

I’ve been tinkering around with the rake file, and when I change

t.spec_files = FileList[‘spec/**/*_spec.rb’]

in the default task to hit just one of the subdirectories, such as

t.spec_files = FileList[‘spec/models/**/*_spec.rb’]

then rake spec works. I’ve done this for models, controllers, and views,
and rake spec works fine for each. But including all of them like

t.spec_files = FileList[‘spec/models//*_spec.rb’,
/_spec.rb’, 'spec/views/**/_spec.rb’]

does not work (same error as mentioned above). Ironically, including
just models and views does work:

t.spec_files = FileList[‘spec/models//*_spec.rb’,

but it seems that any combination including controllers will fail. This
is odd to me since rake spec:controllers works. Unless it has something
to do with the number of files and/or examples. The number of files and
examples for each spec type is

models: 25 files, 391 examples
controllers: 26 files, 973 examples
views: 52 files, 508 examples

Using just rake spec did work on Ruby 1.8.7(-p302) and Ruby

Does anyone have any ideas? I can run each group individually (and even
create an alias to do it all at once), but then rspec has to spin up the
app 3 times. Besides, that doesn’t address why this isn’t working on
ruby 1.9.2.


I can’t explain why, but when I remove

–loadby mtime

from spec/spec.opts, rake spec works again. It might have something
to do with this thread [1], but I don’t know.


[1] http://www.ruby-forum.com/topic/1151108

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs