Closed stardust66 closed 4 years ago
Okay tests are passing! The problem has to do with load order. In spec/spec_helper.rb
there is the line
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
which requires every ruby file in spec/support
. And in spec/support/rspec.rb
, there is this line
config.include Locations
Locations
is defined in the file spec/support/locations.rb
. Here, rspec.rb
assumes that locations.rb
always gets loaded before rspec.rb
by spec_helper.rb
, but this isn't always the case, because the order given by Dir[Rails.root.join("spec/support/**/*.rb")]
is system dependent. This works in trusty but not in xenial, causing tests to fail. It's better to explicitly require locations.rb
in rspec.rb
so Locations
would never be uninitialized.
Thank you for this! Looks awesome, and the explanation makes sense.
I'll merge this soon if there are no comments here (asking to wait/review/ask for changes) from others.
LGTM
Work in Progress:
This PR is for running tests on Travis to try to fix #601.