Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Plugin Tests not Running

#2248

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

Reported by Adam Elliot · March 16th, 2009 @ 07:21 AM

State: duplicate
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. pablobm
    pablobm
    • 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/...

    April 1st, 2009 @ 01:56 PM

  2. James Adam
    James Adam
    • 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.

    April 3rd, 2009 @ 04:58 PM

  3. hiroshi
    hiroshi

    pablobm,

    You seem to paste a wrong url, the identical to this issue:)
    I suppose the right isssue is #1878 a generated plugin's tests are not run by 'rake test'

    June 13th, 2009 @ 04:17 PM

  4. CancelProfileIsBroken