[rspec-users] Rake generate - not generating spec files

Pixel thecatwasnot at gmail.com
Tue Feb 22 21:46:00 EST 2011


On Tue, Feb 22, 2011 at 8:35 PM, Jason Nah <jason.nah at gmail.com> wrote:
> Howdy,
> I'm running the following stack:
>
> rails 3.0.4
> rake (0.8.7)
> rspec 2.5.0
> rspec-rails 2.5.0
>
> I created the rails app, and I didn't tell rails to exclude the default Test
> mechanisms.
> I installed it using
> rails generate rspec:install
> When I type
> rake g model User

I've got a similar stack to yours.  I've always run 'rails g model
User' (note rails not rake) but if I try 'rake g' it spits out an
error, so if you're running the rails script instead, I could be
wrong.

> I get this:
>       invoke  active_record
>       create    db/migrate/20110223022101_create_users.rb
>       create    app/models/user.rb
>       invoke    test_unit
>       create      test/unit/user_test.rb
>       create      test/fixtures/users.yml
> No specs.
> When I type
> rake -T
> I don't see any spec targets.
> When I run rake spec, nothing happens.
>

Is rspec-rails in both your :test and :development groups in your
Gemfile?  It needs to be in :development to provide the rake tasks and
generators.  See David's blog [1] for more info.

> Is there something I've missed?
> Cheers,
> Jason
>

-Cole

[1] http://blog.davidchelimsky.net/tag/generators/


More information about the rspec-users mailing list