Closed drwl closed 5 years ago
This is because the appraisal DSL is a normal Ruby instance_eval
with a different evaluation context, rather than using a parser like Ripper and regenerating from the parse tree. Fixing this issue would require rewriting appraisal pretty much from scratch.
One workaround for this that's worked for me is to generate the gemfiles in the same environment that they're used, in the setup code. The gemfile generation is quick, so there's no need to keep the generated files in your repo when you can recreate them all in less than a second in your test setup code. You can add the entire gemfiles directory to your .gitignore with no loss of functionality.
That makes sense. Thanks for the explanation, really appreciate you going in depth! Closing the issue.
Running
bundle exec appraisal install
on a gem file that has a conditional is evaluated instead of being copied to the appraisal generated gem file.