views:

73

answers:

1

I was all setup with Rspec and Autotest before I updated to Rails 3.

When running rspec spec/ I'm getting:

* spec/spec.opts is deprecated.
* please use ./.rspec or ~/.rspec instead.

I tried changed spec.opts to spec.rspec and running rspec spec/ again. But now I get a whole mess of warnings:

DEPRECATION WARNING: Use toplevel init.rb; rails/init.rb is deprecated:

DEPRECATION WARNING: reset_javascript_include_default is deprecated. Please manipulate config.action_view.javascript_expansions[:defaults] directly. 

DEPRECATION WARNING: RAILS_ENV is deprecated. Please use ::Rails.env.

DEPRECATION WARNING: Use toplevel init.rb; rails/init.rb is deprecated:

DEPRECATION WARNING: You are using the old router DSL which will be removed in Rails 3.1. Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/.

Autotest isn't working either. I'm getting:

.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I.:lib:test -rubygems -e "['test/unit', 'spec/integration/layout_links_spec.rb', 'test/unit/color_test.rb', 'test/functional/products_controller_test.rb', 'spec/integration/users_spec.rb', 'test/functional/colors_controller_test.rb', 'test/unit/product_test.rb', 'test/unit/helpers/products_helper_test.rb', 'test/unit/helpers/colors_helper_test.rb'].each { |f| require f }" | .rvm/gems/ruby-1.9.2-p0/gems/autotest-4.3.2/bin/unit_diff -u

:29:in require': no such file to load -- spec_helper (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire' from spec/integration/layout_links_spec.rb:1:in <top (required)>' from <internal:lib/rubygems/custom_require>:29:inrequire' from :29:in require' from -e:1:inblock in ' from -e:1:in each' from -e:1:in'

Any ideas?

A: 

The deprecation warnings are because of your upgrade to Rails 3, not because of RSpec. Rails 3 has a very different architecture, and the API has also changed significantly. Have you run your project through the rails_upgrade plugin? Also, check out the Rails 3 Release Notes for help on fixing the parts of your application that rely on deprecated functionality.

The second issue is probably because ruby 1.9.2 no longer puts the current directory on the load path. You'll need to manually include spec/ into the load path from your spec.opts.

Jacob
Jacob, thanks for the response. I did run the rails_upgrade plugin. I will also check out the Release Notes.
teecraft