0
我被困在试图从rake文件中调用单个单元测试方法来自动执行我的测试,但我一直收到错误。每次我运行'rake manage'时,在我的'管理'任务中出现错误:错误的参数数量为0,表示为1。这里是我的耙文件:来自rakefile的Test :: Unit :: TestCase?
require "test_file"
task :default => [:commands]
task :manage do
myTest = Unit_Test.new
myTest.test
end
而我的实际类已使用Test :: Unit :: TestCase类。这是在一个名为'test_file.rb'的单独文件中。
class Unit_Test < Test::Unit::TestCase
include Rack::Test::Methods
def test
puts "this is just a test"
end
end
有错误指向:
myTest = Unit_Test.new
我如何调用这个类的单个方法?我基本上想调用这个类的某些方法来完成不同的任务,但我无法实现它的工作。我如何得到这个工作?