当我使用带有Test :: Unit 2.1.1的Mocha 0.9.8时,为什么会出现NoMethodError

时间:2010-08-28 19:36:05

标签: ruby mocha testunit

有没有人见过这个?这是错误:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -rrubygems -e "require 'redgreen'"  -I.:lib:test -rubygems -e "['test/unit', 'test/test_authentication.rb'].each { |f| require f }" | /Library/Ruby/Gems/1.8/gems/autotest-4.3.2/bin/unit_diff -u
Load/Library/Ruby/Gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/gem_version_201_and_above.rb:31:in `run': undefined method `handle_exception' for #<TestAuthentication:0x101823988> (NoMethodError)
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/test/unit.rb:278
 from -e:2
ed suite -e
Started

这是触发该错误的代码:

require 'test/unit'
require 'mocha'

require 'authentication'
class TestAuthentication < Test::Unit::TestCase
end

1 个答案:

答案 0 :(得分:1)

这已在HEO版本的Mocha中修复,但尚未发布。我希望尽快发布。如果在接下来的几天内没有发布,请发送电子邮件至mailing list