Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move "at least rails 3.1" method to rspec/rails file.

  • Loading branch information...
commit f067d8f05694b8da20e247339b2b89cfe2e8a34b 1 parent 248ce66
@justinko justinko authored
View
4 lib/rspec-rails.rb
@@ -1,9 +1,5 @@
module RSpec
module Rails
- def self.at_least_rails_3_1?
- Gem::Version.new(::Rails.version) >= Gem::Version.new('3.1.0')
- end
-
class Railtie < ::Rails::Railtie
# Rails-3.0.1 requires config.app_generators instead of 3.0.0's config.generators
generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators
View
10 lib/rspec/rails.rb
@@ -1,10 +1,18 @@
require 'rspec/core'
-RSpec::configure do |c|
+RSpec.configure do |c|
c.backtrace_clean_patterns << /vendor\//
c.backtrace_clean_patterns << /lib\/rspec\/rails/
end
+module RSpec
+ module Rails
+ def self.at_least_rails_3_1?
+ Gem::Version.new(::Rails.version) >= Gem::Version.new('3.1.0')
+ end
+ end
+end
+
require 'rspec/rails/extensions'
require 'rspec/rails/view_rendering'
require 'rspec/rails/adapters'
View
5 lib/rspec/rails/application.rb
@@ -1,18 +1,15 @@
-require 'rspec-rails'
module RSpec
module Rails
module Application
RSpec.configuration.add_setting :application, :default => ::Rails.application
- # Raise an error when setting application in Rails < 3.1
unless RSpec::Rails.at_least_rails_3_1?
class << RSpec.configuration
def application=(*)
- raise "Setting the application is only supported on Rails 3.1 and above."
+ raise 'Setting the application is only supported on Rails 3.1 and above.'
end
end
end
-
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.