Test passes alone, but fails under rake

In my development environment (Fedora 15/64-bit, Ruby 1.8.7) I'm
experiencing a problem where a unit test passes in isolation but fails
when run using Rake with TestTask.

What makes it stranger is that it's the same class that fails every
time. And the failures are due to the setup method never being invoked,
which initializes all of the instance variables for the test. The errors
I see are:

34) Error:
test_sync_without_block(TestSession):
NoMethodError: undefined method `should_receive' for nil:NilClass
    /home/mcpierce/Programming/Qpid/qpid/cpp/bindings/qpid/ruby/test/test_session.rb:250:in `test_sync_without_block'

The object that it says is nil is initialized in setup. And putting as
the first line of that method:

raise "HELL!"

never gets executed under Rake, but does when run directly.

Anybody else experience this sort of problem?

You can check out the code here:

http://github.com/mcpierce/Qpid/tree/Fix-Ruby-unit-tests

where the code is down under $REPO/qpid/cpp/bindings/qpid/ruby

···

--
Darryl L. Pierce <mcpierce@gmail.com>
http://mcpierce.multiply.com/
"What do you care what people think, Mr. Feynman?"