It seems that because ActiveSupport::TestCase fails
to require test/unit before requiring
test/unit/testcase none of the test cases that inherit
from ActiveSupport::TestCase are being run.
Normal Rails application tests that require
test_helper, which in turn requires
environment, don't exhibit this problem. This is
possibly due to the fact that test/unit is required
somewhere during Rails initialization.
I came across the issue when trying to run tests for a plugin
created by Rails' own plugin generator which creates a
test_helper which requires
ActiveSupport::TestCase
The following won't execute any tests:
#
# test_helper.rb
#
require 'rubygems'
require 'active_support'
require 'active_support/test_case'
#
# my_plugin_test.rb
#
require 'test_helper'
class MyPluginTest < ActiveSupport::TestCase
test "the truth" do
assert true
end
end
I am attaching the one-line patch which fixes it for me. I tried
to figure a way to test that the test cases are run, but to be
honest, I am lost. If anyone wants to point me to the right
direction, I'll give it another try.