3

i am working on rails 2.3.5 where i want to us Rspec for testing purpose. I have installed rspec gem but not able to list rspec in generator's list. I am referring https://github.com/rspec/rspec-rails.

group :development, :test do
  gem "rspec", "~> 1.3"
  gem "rspec-rails", "~> 1.3"
end

Thanks.

Prabesh Shrestha
  • 2,732
  • 4
  • 29
  • 44
ashisrai_
  • 6,438
  • 2
  • 26
  • 42
  • Where did you put that content? Did you set up Bundler correctly? – Ryan Bigg Aug 03 '11 at 06:55
  • @Ryan => bundler is working fine and I am able to install all the gems with bundler. I have put the above content in a Gemfile. – ashisrai_ Aug 03 '11 at 07:28
  • @Ryan Thanks Ryan. It turns out I had to include other gems as well to run the rspec. I added gem "rspec", "~> 1.3" gem "rspec-core" gem "rspec-expectations" gem "rspec-mocks" gem "rspec-rails", "~> 1.3" gem "shoulda" now its working fine. – ashisrai_ Aug 03 '11 at 07:37
  • I made it work with the generator. Added spec folder and manually added the spec_helper file and added it to the spec file. – ashisrai_ Aug 03 '11 at 07:39

1 Answers1

6

If you are on rails 2.3.5 you will have to install two plugins :

ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.9'

and

ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.9'

Then check the rspec generate list

ruby script/generate rspec

Please check https://github.com/dchelimsky/rspec/wiki/rails for further details.

Hope this helps.

Prabesh Shrestha
  • 2,732
  • 4
  • 29
  • 44