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/ext_verifier.rb
2015-01-20 10:22:26 -05:00

42 lines
734 B
Ruby

module ExtVerifier
def require_dependencies!(dependencies)
dependencies.each do |dependency|
begin
require dependency
rescue LoadError
end
end
end
module_function :require_dependencies!
def has_rails?
defined?(Rails)
end
module_function :has_rails?
def has_mongoid?
defined?(Mongoid)
end
module_function :has_mongoid?
def has_mongo_mapper?
defined?(MongoMapper)
end
module_function :has_mongo_mapper?
def has_ripple?
defined?(Ripple)
end
module_function :has_ripple?
def has_nobrainer?
defined?(NoBrainer)
end
module_function :has_nobrainer?
end
RSpec.configure do |config|
config.include(ExtVerifier)
config.extend(ExtVerifier)
end