Skip to content

Instantly share code, notes, and snippets.

@adilsoncarvalho
Created July 3, 2011 03:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adilsoncarvalho/1061938 to your computer and use it in GitHub Desktop.
Save adilsoncarvalho/1061938 to your computer and use it in GitHub Desktop.
How to install RSpec to your ruby gems
#
# if you are using RVM installed system wide (root)
# REMEMBER: if you are using RVM system wide NEVER run sudo gem install !!!!
#
rvmsudo gem install rspec rspec-rails rspec-rails-matchers
#
# if you are using RVM only on your local user or not using RVM at all
#
gem install rspec rspec-rails rspec-rails-matchers
#
# Modify your Gemfile to add those lines
#
group :development, :test do
gem 'rspec'
gem 'rspec-rails'
gem 'rspec-rails-matchers'
end
#
# open a terminal and go to your Rails project and there run
#
rails generate rspec:install
#
# Here I have an etire transcription from the session
#
adilson@mahat :: ~/Dojo/rspec-test (master)
$ rails g scaffold User name:string
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
invoke active_record
create db/migrate/20110703030955_create_users.rb
create app/models/user.rb
invoke rspec
create spec/models/user_spec.rb
route resources :users
invoke scaffold_controller
create app/controllers/users_controller.rb
invoke erb
create app/views/users
create app/views/users/index.html.erb
create app/views/users/edit.html.erb
create app/views/users/show.html.erb
create app/views/users/new.html.erb
create app/views/users/_form.html.erb
invoke rspec
create spec/controllers/users_controller_spec.rb
create spec/views/users/edit.html.erb_spec.rb
create spec/views/users/index.html.erb_spec.rb
create spec/views/users/new.html.erb_spec.rb
create spec/views/users/show.html.erb_spec.rb
invoke helper
create spec/helpers/users_helper_spec.rb
create spec/routing/users_routing_spec.rb
invoke rspec
create spec/requests/users_spec.rb
invoke helper
create app/helpers/users_helper.rb
invoke rspec
invoke stylesheets
create public/stylesheets/scaffold.css
adilson@mahat :: ~/Dojo/rspec-test (master)
$ rake db:migrate
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.0040s
== CreateUsers: migrated (0.0040s) ===========================================
adilson@mahat :: ~/Dojo/rspec-test (master)
$ rake spec:controllers
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
/usr/local/rvm/rubies/jruby-1.6.2/bin/jruby -S bundle exec rspec ./spec/controllers/users_controller_spec.rb
LoadError: no such file to load -- spec_helper
require at org/jruby/RubyKernel.java:1038
(root) at /Users/adilson/Dojo/rspec-test/spec/controllers/users_controller_spec.rb:1
load at org/jruby/RubyKernel.java:1063
load_spec_files at /Users/adilson/Dojo/rspec-test/spec/controllers/users_controller_spec.rb:419
collect at org/jruby/RubyArray.java:2336
load_spec_files at /usr/local/rvm/gems/jruby-1.6.2/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419
run at /usr/local/rvm/gems/jruby-1.6.2/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18
run_in_process at /usr/local/rvm/gems/jruby-1.6.2/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80
run at /usr/local/rvm/gems/jruby-1.6.2/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69
autorun at /usr/local/rvm/gems/jruby-1.6.2/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11
call at org/jruby/RubyProc.java:268
call at org/jruby/RubyProc.java:232
rake aborted!
ruby -S bundle exec rspec ./spec/controllers/users_controller_spec.rb failed
Tasks: TOP => spec:controllers
(See full trace by running task with --trace)
adilson@mahat :: ~/Dojo/rspec-test (master)
$ rails generate rspec:install
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
create .rspec
exist spec
create spec/spec_helper.rb
adilson@mahat :: ~/Dojo/rspec-test (master)
$ rake rspec:controllers
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
rake aborted!
Don't know how to build task 'rspec:controllers'
(See full trace by running task with --trace)
adilson@mahat :: ~/Dojo/rspec-test (master)
$ rake spec:controllers
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
/usr/local/rvm/rubies/jruby-1.6.2/bin/jruby -S bundle exec rspec ./spec/controllers/users_controller_spec.rb
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
/usr/local/rvm/gems/jruby-1.6.2/gems/rspec-rails-matchers-0.2.1/lib/rspec-rails-matchers.rb:68:in `require'
* Rspec is deprecated.
* RSpec is the new top-level module in RSpec-2
***************************************************************
................
Finished in 1.01 seconds
16 examples, 0 failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment