Closed richardvenneman closed 9 years ago
For test dependencies, I'd recommend you put them in your Gemfile. Bundler doesn't have great integration for gemspec dev dependencies. In other words, dev deps aren't loaded when you run bundle exec
.
To answer your question about testing Rails engines, yes. You'll also want to adjust your config.root
to point to your engine's root.
Basically what @mikepack says. Development dependencies are not installed and known about via bundler -- and there isn't a way to tell bundler to include them. This is easy to confirm by looking at your Gemfile.lock
file and noting that teaspoon-mocha
will not be listed -- then shift your gemspec to include it as a add_dependency
instead of add_development_dependency
-- it will be listed.
The way most people resolve this sort of thing is to put it in your Gemfile under a :development
group as well as the gemspec, though I personally don't bother putting it in the gemspec at that point.
There's a wiki about testing engines -- @mikepack is this still accurate? https://github.com/modeset/teaspoon/wiki/Testing-Engine-Assets
@jejacks0n looks current.
Hi there!!
i have teaspoon-mocha inside the lock file, all set.. but when i run generattor get same error.. opened a new issue as this is 1 year old https://github.com/modeset/teaspoon/issues/496
I added
teaspoon-mocha
to my gemspec with:and ran
bundle install
. While Bundler reported that the teaspoon and teaspoon-mocha gems installed correctly, runningbundle exec rails g teaspoon:install
raises the following error:Is it possible to test the assets in my Rails engine?