A recent discussion here has brought konacha, an engine for testing
common code from several applications into an engine and there I would
like to add some tests for the scripts.
With current versions of Rails, when I create an engine with
$ rails new plugin my_engine --mountable
among all the other niceties I get is an dummy application for testing
purposes in test/dummy. Unfortunately, things are not set-up properly
for testing. Dependencies specified in my_engine.gemspec are not loaded,
or if they are they are loaded too late. As a consequence, the asset
paths from the jquery-rails engine are not added to the dummy
application's asset paths.
In order to get those engines loaded at the right time, I need to add
explicit requires in test/dummy/config/application.rb, just below the
generated require "my_engine". Ideally, none of these requires would be
necessary and Bundler.require (that's already there) would automatically
load all dependencies from the enclosing engine's gemspec.
For the specific case of konacha that still would not be enough (on top
of this, it needs to set different additional asset paths, then when in
an app environment), but it would be a good start.