Permalink
Browse files

Explicitly specify the scope of Rails

* If another gem defines `Rspec::Rails` before us, `Rails` might qualify
  to `Rspec::Rails` (at least in 1.9)
* Fixes #555
  • Loading branch information...
1 parent 6695a58 commit 31c5ab6133e208e516931dd1d8a80322fe8f3279 @alindeman alindeman committed Jun 3, 2012
View
@@ -1,6 +1,12 @@
### dev
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.10.1...master)
+Bug fixes
+
+* "uninitialized constant" errors are avoided when using using gems like
+ `rspec-rails-uncommitted` that define `Rspec::Rails` before `rspec-rails`
+ loads (Andy Lindeman)
+
Enhancements
* The generated `spec/spec_helper.rb` sets `config.order = "random"` so that
View
@@ -2,7 +2,7 @@
module Rspec
module Generators
- class Base < Rails::Generators::NamedBase
+ class Base < ::Rails::Generators::NamedBase
def self.source_root
@_rspec_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'rspec', generator_name, 'templates'))
end
@@ -1,6 +1,6 @@
module Rspec
module Generators
- class InstallGenerator < Rails::Generators::Base
+ class InstallGenerator < ::Rails::Generators::Base
desc <<DESC
Description:
@@ -4,7 +4,7 @@
module Rspec
module Generators
class ScaffoldGenerator < Base
- include Rails::Generators::ResourceHelpers
+ include ::Rails::Generators::ResourceHelpers
source_paths << File.expand_path("../../helper/templates", __FILE__)
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"

0 comments on commit 31c5ab6

Please sign in to comment.