[rspec-devel] Loading RSpec on Rails

Adam Williams adam at thewilliams.ws
Tue Mar 18 11:12:21 EDT 2008


Folks,

I have built a plugin called 'Scenarios', which allows me to create  
data for tests. I have specs for it, but historically have had to  
modify rspec_on_rails very slightly to get them to run. Here's the deal:

1. Require everything necessary for testing a rails plugin and using  
rspec_on_rails

require 'active_support'
require 'active_record'
require 'action_controller'
require 'action_view'
require 'spec/rails'

2. I get an error when requiring 'spec/rails', which ultimately fails  
when requiring rspec_on_rails/edge/lib/spec/rails/extensions/spec/ 
example/configuration.rb

  activesupport/edge/lib/active_support/dependencies.rb:263:in  
`load_missing_constant': uninitialized constant  
Spec::Rails::Example::RailsExampleGroup (NameError)
  activesupport/edge/lib/active_support/dependencies.rb:453:in  
`const_missing'
  rspec_on_rails/edge/lib/spec/rails/extensions/spec/example/ 
configuration.rb:14
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 
1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 
1.8/rubygems/custom_require.rb:27:in `require'
  activesupport/edge/lib/active_support/dependencies.rb:496:in `require'
  activesupport/edge/lib/active_support/dependencies.rb:342:in  
`new_constants_in'
  activesupport/edge/lib/active_support/dependencies.rb:496:in `require'
  rspec_on_rails/edge/lib/spec/rails/extensions.rb:5 ... 22 levels...

3. I have 'fixed' this in the past by applying a patch like this one http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/testing/rspec_on_rails_3119.patch


I'm not interested in doing that any more. Does anyone know a good way  
to resolve this problem?

Thank you,

    adam williams




More information about the rspec-devel mailing list