1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00
awesome_print/spec/support/rails_versions.rb
Mauro George 526f907629 Improves spec runner harness, switches to better env detection.
Does not run rails specs when running mongoid specs

WIP Start of remove BRE to check tests

Remove old helper of active record

Use RSpec skip to skip AR specs

Run ActionView only when needed

Run ActiveSupport only when needed

Run Mongoid only when needed

Create ExtVerifier.require_dependencies

Run MongoMapper only when needed

Always load nokogiri specs

Always load ostruct specs

Run Ripple only when needed

Remove :: when check for defined constants

Require spec_helper directly

Remove 1.8.6 old monkey patch

Add some RSpec configs
2015-01-02 13:20:18 -05:00

30 lines
740 B
Ruby

module RailsVersions
def rails_version
Gem::Version.new(Rails::VERSION::STRING)
end
def rails_4_2?
Gem::Requirement.new('~> 4.2.0').satisfied_by?(rails_version)
end
alias_method :activerecord_4_2?, :rails_4_2?
def rails_4_1?
Gem::Requirement.new('~> 4.1.0').satisfied_by?(rails_version)
end
alias_method :activerecord_4_1?, :rails_4_1?
def rails_4_0?
Gem::Requirement.new('~> 4.0.0').satisfied_by?(rails_version)
end
alias_method :activerecord_4_0?, :rails_4_0?
def rails_3_2?
Gem::Requirement.new('~> 3.2.0').satisfied_by?(rails_version)
end
alias_method :activerecord_3_2?, :rails_3_2?
end
RSpec.configure do |config|
config.include(RailsVersions)
config.extend(RailsVersions)
end