let the specs run on Rails || Sinatra
This commit is contained in:
parent
88a9680053
commit
a87acfb768
|
@ -1,7 +1,11 @@
|
||||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
||||||
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
||||||
|
|
||||||
require 'rails'
|
begin
|
||||||
|
require 'rails'
|
||||||
|
rescue LoadError
|
||||||
|
end
|
||||||
|
|
||||||
require 'bundler/setup'
|
require 'bundler/setup'
|
||||||
Bundler.require
|
Bundler.require
|
||||||
|
|
||||||
|
@ -10,9 +14,15 @@ require 'database_cleaner'
|
||||||
# Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded.
|
# Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded.
|
||||||
require 'fake_gem' if defined? ActiveRecord
|
require 'fake_gem' if defined? ActiveRecord
|
||||||
|
|
||||||
require 'fake_app/fake_app'
|
if defined? Rails
|
||||||
|
require 'fake_app/fake_app'
|
||||||
|
|
||||||
|
require 'rspec/rails'
|
||||||
|
end
|
||||||
|
if defined? Sinatra
|
||||||
|
require 'spec_helper_for_sinatra'
|
||||||
|
end
|
||||||
|
|
||||||
require 'rspec/rails'
|
|
||||||
# Requires supporting files with custom matchers and macros, etc,
|
# Requires supporting files with custom matchers and macros, etc,
|
||||||
# in ./support/ and its subdirectories.
|
# in ./support/ and its subdirectories.
|
||||||
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
||||||
|
|
Loading…
Reference in New Issue