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 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 there something I''ve missed?
Cheers,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/rspec-users/attachments/20110223/70e1a941/attachment.html>
David Chelimsky
2011-Feb-23 02:38 UTC
[rspec-users] Rake generate - not generating spec files
On Feb 22, 2011, at 8:35 PM, Jason Nah 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 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 there something I''ve missed?Is rspec-rails in your Gemfile? group :test, :development do gem "rspec-rails", "~> 2.5" end -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110222/4294fce5/attachment.html>
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 UserI''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/
I had a similar problem, then I noticed that I didn''t include gem ''rspec-rails'' in my development environment like what David mentioned above. That fixed the problem I had. I''m running the following stack: - rails 3.0.3 - - rake (0.8.7) - rspec 2.5.0 - rspec-rails 2.5.0 On Feb 23, 10:46?am, Pixel <thecatwas... at gmail.com> wrote:> On Tue, Feb 22, 2011 at 8:35 PM, Jason Nah <jason.... 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/ > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users