Ruby 测试单元:未初始化常量 Test::Unit::UnitCase
我正在尝试运行此测试,但遇到了问题。每次我尝试运行测试时,都会收到以下错误:
未初始化常量 Test::Unit::UnitCase
我在 Windows 7、ruby 186 上运行它。 路径指向C:\ruby186\bin Ruby Bin C:\ruby186\bin
这不是 Rails 应用程序。这只是红宝石。
这是代码:
require 'rubygems'
require 'test/unit'
require 'shoulda'
require './AngryBadger'
class AngryBadger < Test::Unit::UnitCase
def setup
test_uri = ""
@ab = AngryBadger.new()
end
should "have no fear" do
assert(true)
end
end
我怀疑这可以通过配置来修复,但我不知道我能做什么。
I am trying to run this test, but I am running int a problem. Every time that I attempt to run the test, I am getting the following error:
uninitialized constant Test::Unit::UnitCase
I am running it on Windows 7, ruby 186.
Path points to C:\ruby186\bin
Ruby Bin C:\ruby186\bin
This is not a rails app. This is just ruby.
This is the code:
require 'rubygems'
require 'test/unit'
require 'shoulda'
require './AngryBadger'
class AngryBadger < Test::Unit::UnitCase
def setup
test_uri = ""
@ab = AngryBadger.new()
end
should "have no fear" do
assert(true)
end
end
I suspect that this can be fixed through configuration, but I don't know what I could do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该从
Test::Unit::TestCase
进行子类化:You should be subclassing from
Test::Unit::TestCase
instead: