Skip to content

Commit

Permalink
Make sure spec_helper is loaded first
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Feb 16, 2021
1 parent 4abc185 commit 660122a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions spec/integration/mongoid/spec_helper.rb

This file was deleted.

10 changes: 7 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ def testing_mongoid?
require f
end

if testing_rails?
require "integration/rails/spec_helper"
end

# Load dependencies
['Mongoid', 'Rails'].each do |integration|
begin
Object.const_get(integration)
Dir["#{File.dirname(__FILE__)}/integration/#{integration.downcase}/**/*.rb"].each do |f|
if f.end_with?("spec_helper.rb") || ENV["TEST"].nil?
require f
if ENV["TEST"].nil?
Dir["spec/integration/#{integration.downcase}/**/*.rb"].each do |f|
require f.sub("spec/", "")
end
end
rescue NameError
Expand Down

0 comments on commit 660122a

Please sign in to comment.