[rspec-users] Difference between gem and plugin

Luis Lavena luislavena at gmail.com
Sat Oct 4 14:06:44 EDT 2008


On Sat, Oct 4, 2008 at 2:58 PM, David Chelimsky <dchelimsky at gmail.com> wrote:
> On Sat, Oct 4, 2008 at 11:54 AM, Fernando Perez <lists at ruby-forum.com> wrote:
>> How do you go plugin-less for RSpec? The plugins require you to generate
>> some files, so how do you do that without a plugin? Is there still a
>> rake task in the gem to generate the required files?
>
> I'll post this up on the wiki, but the steps are:
>
> [sudo] gem install rspec-rails
> script/generate rspec
>
> That's it.
>
> rspec is a dependency of rspec-rails, so installing the rspec-rails
> gem will also install the rspec gem.
>
> Once installed, if you type 'script/generate' with no arguments,
> you'll see all the rspec generators listed. 'script/generate rspec'
> generates the files necessary to work with rspec without having to
> install the plugins in your app.
>

It doesn't :-P

Just tried that on a fresh application, and when call script/generate
rspec it just not find it and don't execute it :-P

Also, going to the gem version instead of the plugin requires a new
set of script files, since they try to look for vendor/plugins/
instead of doing:

require 'rubygems'
require 'spec'

Last, but not least, you need to do

config.gem 'rspec-rails', :lib => 'spec/rails' since Rails will try by
default to load 'rspec-rails' module instead.

Wow, lot of details :-P

Cheers,
-- 
Luis Lavena
AREA 17
-
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams


More information about the rspec-users mailing list