[mocha-developer] New error?

Ned Wolpert ned.wolpert at gmail.com
Wed Feb 6 08:17:15 EST 2008


Yeah, I use the head of Mocha... so my tests auto-update to the lasted
and execute on svn checkins. I need to track Mocha back to 251 because
after this error, tests just stop...

It seems like when my rails environment is loaded (Rails 2.0.2) the
mocha_setup doesn't occur so 'mockery' doesn't get built in the
mocha_setup. Again, no clue why. Runs fine within just a ruby call and
the library without the rails framework... so something isn't playing
well there it seems.

On Feb 6, 2008 1:53 AM, James Mead <jamesmead44 at gmail.com> wrote:
> Hmm. I don't see this problem running Mocha revision 254 as a Rails plugin
> with Rails 1.2.3.
>
> What version of Rails are you running? And have you tried updating to
> revision 254?
>
> I'll try going back to revision 251 when I have some time later today.
>
> Thanks.
>
>
> On 06/02/2008, Ned Wolpert <ned.wolpert at gmail.com> wrote:
> >
> > In this case, no real code is needed... It looks like the @mockery
> > code isn't getting initialized.
> >
> > I did a test case but its nothing major......here is my test case:
> > mocha_test.rb:
> > ----------------------------------- Cut Here-->
> > require File.dirname(__FILE__) + '/../test_helper'
> >
> > require 'stubba'  # It still fails if this line isn't there...
> >
> > class MochaTest < Test::Unit::TestCase
> >
> >   # Replace this with your real tests.
> >   def test_truth
> >     assert true
> >   end
> > end
> > ----------------------------------- Cut Here-->
> >
> > Run command: ruby test/unit/mocha_test.rb
> >
> > Output:
> > Started
> >
> > /home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/standalone.rb:151:in
> > `mocha_teardown': You have a nil object when you didn't expect it!
> > (NoMethodError)
> > The error occurred while evaluating nil.teardown        from
> >
> > /home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/test_case_adapter.rb:50:in
> > `run'
> >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
> >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
> >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
> >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
> >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
> >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
> >         from /usr/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
> > `run_suite'
> >         from /usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
> > `start_mediator'
> >         from /usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
> > `start'
> >         from /usr/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
> > `run'
> >         from /usr/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
> >         from /usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
> >         from /usr/lib/ruby/1.8/test/unit.rb:278
> >         from test/unit/mocha_test.rb:8
> >
> >
> > On Feb 5, 2008 5:32 PM, James Mead <jamesmead44 at gmail.com> wrote:
> > > Hmm. Can you (a) try updating to HEAD i.e. revision 254; and (b) give me
> > an
> > > example test case that gives you the error (ideally the simplest you can
> > > make it). Thanks.
> > >
> > >
> > > On 05/02/2008, Ned Wolpert <ned.wolpert at gmail.com> wrote:
> > > >
> > > > In the head, I'm getting a new error that does not look like its one
> > > > of mine... started in rev 251... if it is mine, can anyone tell me
> > > > where to look?
> > > >
> > > > here's the stack:
> > > >
> > > >
> > > > Started
> > > >
> > > >
> > /home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/standalone.rb:151:in
> > > > `mocha_teardown': You have a nil object when you didn't expect it!
> > > > (NoMethodError)
> > > > The error occurred while evaluating nil.teardown        from
> > > >
> > > >
> > /home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/test_case_adapter.rb:50:in
> > > > `run'
> > > >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
> > > >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
> > > >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
> > > >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
> > > >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
> > > >         from /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
> > > >         from
> > /usr/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
> > > > `run_suite'
> > > >         from
> > /usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
> > > > `start_mediator'
> > > >         from
> > /usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
> > > > `start'
> > > >         from
> > /usr/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
> > > > `run'
> > > >         from /usr/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
> > > >         from /usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
> > > >         from /usr/lib/ruby/1.8/test/unit.rb:278
> > > >         from test/unit/processor_application_test.rb:21
> > > >
> > > > --
> > > > Virtually, Ned Wolpert
> > > > http://www.codeheadsystems.com/blog/
> > > >
> > > > "Settle thy studies, Faustus, and begin..."   --Marlowe
> > > > _______________________________________________
> > > > mocha-developer mailing list
> > > > mocha-developer at rubyforge.org
> > > > http://rubyforge.org/mailman/listinfo/mocha-developer
> > > >
> > >
> > >
> > >
> > > --
> > > James.
> > > http://blog.floehopper.org
> > > http://tumble.floehopper.org
> > > _______________________________________________
> > > mocha-developer mailing list
> > > mocha-developer at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/mocha-developer
> > >
> >
> >
> >
> > --
> > Virtually, Ned Wolpert
> > http://www.codeheadsystems.com/blog/
> >
> > "Settle thy studies, Faustus, and begin..."   --Marlowe
> > _______________________________________________
> > mocha-developer mailing list
> > mocha-developer at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/mocha-developer
> >
>
>
>
> --
> James.
> http://blog.floehopper.org
> http://tumble.floehopper.org
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer
>



-- 
Virtually, Ned Wolpert
http://www.codeheadsystems.com/blog/

"Settle thy studies, Faustus, and begin..."   --Marlowe


More information about the mocha-developer mailing list