[rspec-users] RSpec 2 not finding specs from subdirectories when trying to run specs from there

Chris Habgood chabgood at gmail.com
Wed Jun 1 10:22:37 EDT 2011

Try this in your spec helper file:

Dir[Rails.root.join("spec/factories/**/*.rb")].each {|f| require f}

On Wed, Jun 1, 2011 at 09:14, Jarmo Pertman <jarmo.p at gmail.com> wrote:

> Hi!
> When having a file structure like this:
> project
>  -spec
>    -subdir
>      -my_spec.rb
> and then being in directory "project" and running command `rspec spec`
> everything works as expected. If running `rspec spec/subdir` to run
> only specs under spec/subdir then it doesn't work - it finds 0
> examples. It works as expected in RSpec 1. What do we do wrong?
> Jarmo
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

*"In matters of style, swim with the current; in matters of principle, stand
like a rock."
Thomas Jefferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110601/f8b64e92/attachment.html>

More information about the rspec-users mailing list