This project is archived and is in readonly mode.
Plugin Tests not Running
Reported by Adam Elliot | March 16th, 2009 @ 07:21 AM | in 2.x
I'm not sure if this is a bug or I'm not using the feature set as intended, but I'm having issues executing test cases right from my plugin. It appears things aren't running as expected right from the get go (script/generate plugin blah).
Here's what's going on. I've generated a new plugin (rails 2.3rc2, but I've tried this on 2.2.2 and it does the same thing):
script/generate plugin blah
When I switch to the plugins folder and run the default tests:
cd vendor/plugins/blah
rake test
It loads all the tests, but none of them actually run. If I change the default test to:
test "the truth" do
assert false
end
It doesn't fail.
If I run rake test:plugins
from RAILS_ROOT the
tests fail, but it also loads portions of the application code,
which is undesirable. Should rake test
work in the
plugin's folder or am I misunderstanding things?
Thanks, Adam
Comments and changes to this ticket
-
pablobm April 1st, 2009 @ 01:56 PM
- Tag changed from 2.2.2, 2.3-rc2, testcase to 2.2.2, 2.3-rc2, duplicate, testcase
Seems to be a duplicate of https://rails.lighthouseapp.com/...
-
James Adam April 3rd, 2009 @ 04:58 PM
- Tag changed from 2.2.2, 2.3-rc2, duplicate, testcase to 2.2.2, 2.3-rc2, patch, plugin, test, testcase
(removing the duplicate tag because the link provided links to this same ticket, and I couldn't find an obvious duplicate via search)
I believe this is caused by the fact that activesupport/testcase never actually requires 'test/unit', which has the hooks to run your test.
This may be a conscious decision to prevent clashing with plugins that wish to use other testing frameworks, although if that's the case then they probably shouldn't be requiring activesupport/testcase either.
I've attached a simple patch to fix this, and hopefully make it clearer.
-
hiroshi June 13th, 2009 @ 04:17 PM
pablobm,
You seem to paste a wrong url, the identical to this issue:)
I suppose the right isssue is https://rails.lighthouseapp.com/projects/8994/tickets/1878-a-genera... -
CancelProfileIsBroken June 15th, 2009 @ 12:42 PM
- State changed from new to duplicate
Duplicate of #1878
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2248 Plugin Tests not Running Seems to be a duplicate of https://rails.lighthouseapp.c...
- 1878 a generated plugin's tests are not run by 'rake test' While this issue has been left months, a duplicated ticke...