I created a Rails 4 app recently and for some reason my rake tasks don't include test
. Here's some console action to demonstrate the problem:
> rake test:units
rake aborted!
Don't know how to build task 'test:units'
/Users/clozach/.rvm/gems/ruby-2.1.3@hoverfly/bin/ruby_executable_hooks:15:in `eval'
/Users/clozach/.rvm/gems/ruby-2.1.3@hoverfly/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
Fail. :(
> rake test
>
No output. :(
> rake -T --all | grep test
rake db:test:clone #
rake db:test:clone_schema #
rake db:test:clone_structure #
rake db:test:deprecated #
rake db:test:load #
rake db:test:load_schema #
rake db:test:load_structure #
rake db:test:prepare #
rake db:test:purge #
rake log:clear # Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)
rake tmp/cache/assets/test #
No test
tasks at all! :'(
Any idea why this is the case, and what I can do to fix it?
Take a look into config/application.rb
whether the testing framework is actually required there. At the very top, there should be
require "rails/all"
Depending on your setup, you might have each individual component required separately. Make sure that test_unit
is among them.
require "rails/test_unit/railtie"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With