thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.25k stars 107 forks source link

Rails loads helpers in the wrong order when running from inside of Appraisal #126

Closed jcmorrow closed 4 years ago

jcmorrow commented 7 years ago

I'm not sure if this is a problem with rails or with Appraisal, but it's caused an issue on Administrate. I made a repo to reproduce based off of the rails issue template. Here's the most concise summary I've made so far:

In 5.0 method(:url_for).source_location returns

.../rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/actionview-5.0.1/lib/action_view/routing_url_for.rb:78

while in 4.2 it returns

.../rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/url_for.rb:150

The latter cannot handle an array as an argument, hence the spec failures, but it seems like it must be some interaction of Appraisal and the rails auto loader that is causing the wrong method lookup, because it doesn't happen when we are running 4.2 outside of Appraisal.

nickcharlton commented 4 years ago

I'm going to close this as it's quite old and the original issue which prompted it has long gone and been solved. We can look at it again if it's still an issue.