Setup not invoked during unit testing

I have a bunch of unit test files in a Rails project. One of them has
stopped using the setup method before each test, or even if I invoke it
in the test itself.

After commenting out most of it, here is what is left:

require ‘test/test_helper’

class GlcTest < ActiveSupport::TestCase
def setup
p ‘###########################’
end

def test_setup
p ‘[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[’
setup
end
end

The file I am testing is glc.rb, and that does get loaded. If I run the
test file, it does work normally; this is a problem when running the
test through rake (either via my IDE or at the command line).

test_setup does get invoked, so the file is being processed. I am
guessing that somewhere there is another setup method that takes
priority, but where would it be, and why does it take priority over this
one? My IDE recognises that this setup overrides the one in
ActiveSupport::TestCase.

There is no setup method defined in glc.rb, and as the problem is
isolated to this one class, I am mystified as to where this other setup
might be.

Any advice appreciated.

Using JRuby 1.5 on Windows, by the way.

On 20 July 2010 15:57, Andy J. [email protected] wrote:

p ‘###########################’
end

def test_setup
p ‘[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[’

You could put a debugger statement here then step in to see where it
goes

Colin

On Jul 20, 3:57 pm, Andy J. [email protected] wrote:

test_setup does get invoked, so the file is being processed. I am
guessing that somewhere there is another setup method that takes
priority, but where would it be, and why does it take priority over this
one? My IDE recognises that this setup overrides the one in
ActiveSupport::TestCase.

is it possible that another of your test cases is also called
GlcTest ?

Fred

Frederick C. wrote:

On Jul 20, 3:57�pm, Andy J. [email protected] wrote:

test_setup does get invoked, so the file is being processed. I am
guessing that somewhere there is another setup method that takes
priority, but where would it be, and why does it take priority over this
one? My IDE recognises that this setup overrides the one in
ActiveSupport::TestCase.

is it possible that another of your test cases is also called
GlcTest ?

Fred

That was it. I had copy-and-pasted from GlcTest to create a new test
class, and had forgotten to change the class name. Thanks for the help.