[rspec-users] Build rspec-rails as a gem?

Ben Mabey ben at benmabey.com
Tue Jun 3 12:31:39 EDT 2008

Pat Maddox wrote:
> On Mon, Jun 2, 2008 at 11:09 PM, Jose Fernandez <lists at ruby-forum.com> wrote:
>> I can't figure out how to build rspec-rails as a gem when just cloned
>> from github... there isn't any .gemspec file or rake task that does
>> this. Any help?
> rspec-rails is a rails plugin, not a gem.
> Pat
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

I have needed to use it as a gem before.  Why?  Well, with ticket 
David extracted the mocking features for AR so that it could be reused 
easily.  I was writing a merb app that used AR and I quickly began 
missing the mock_model and other mock helpers found in rspec-rails.  So, 
I created a gem out of the plugin, installed it locally in my merb app I 
just required 'spec/rails/mocks'.

The gemspec file I created to do this was:

Gem::Specification.new do |s|
  s.name = %q{rspec-rails}
  s.version = "1.1.4"

  s.specification_version = 2 if s.respond_to? :specification_version=

  s.required_rubygems_version = Gem::Requirement.new(">= 0") if 
s.respond_to? :required_rubygems_version=
  s.authors = ["RSpec Development Team"]
  s.date = %q{2008-05-25}
  s.default_executable = %q{spec}
  s.description = %q{RSpec-Rails is an extension to RSpec to provide a 
better environment for specing rails.}
  s.email = %q{rspec-devel at rubyforge.org}
  s.extra_rdoc_files = ["README", "CHANGES", "MIT-LICENSE"]
  s.files = ["CHANGES", "MIT-LICENSE", "Rakefile", "README", 
"lib/autotest/discover.rb", "lib/autotest/rails_rspec.rb", 
_group.rb", "lib/spec/rails/example/functional_example_group.rb", 
b", "lib/spec/rails/example/render_observer.rb", 
"lib/spec/rails/extensions/active_record/base.rb", "lib/spec/rails/ex
"lib/spec/rails/matchers/assert_select.rb", "li
"lib/spec/rails/matchers.rb", "lib/spec/ra
ils/mocks.rb", "lib/spec/rails/story_adapter.rb", 
"lib/spec/rails/version.rb", "lib/spec/rails.rb"]
  s.has_rdoc = true
  s.homepage = %q{http://rspec.rubyforge.org}
  s.rdoc_options = ["--title", "RSpec-Rails", "--line-numbers", 
"--inline-source", "--main", "README"]
  s.require_paths = ["lib"]
  s.rubygems_version = %q{1.1.0}
  s.summary = %q{RSpec-Rails-1.1.4 (build 20080526202855) - BDD for Ruby 

More information about the rspec-users mailing list