开发者

Test::Unit::TestCase from rakefile?

I'm stuck trying to call individual unit test methods from a rake file to automate my testing but I keep getting an error. Every time I run 'rake manage' I get an error in my 'manage' task saying: wrong number of arguments 0 for 1. Here is my rake file:

require "test_file"
    task :default => [:commands]

    task :manage do 
         myTest = Unit_Test.new
         myTest.test
    end

And my actual class that has uses the Test::Unit::TestCase class. This is in a separate file called 'test_file.rb'.

class Unit_Test < Test::Unit::TestCase
  include Rack::Test::Methods
    def test 
      puts "this is just a test"
    end
end

There error is pointing to:

 myTest = Unit_Test.new

How do I call individual method开发者_开发百科s from this class? I basically want to call certain methods from this class in different tasks but I cannot get it to work. How do I get this working?


Have you considered doing

ruby test_file.rb --name test_method_to_be_run

Or do you need to run multiple test methods?

Also, what version of Ruby are you using? 1.8 or 1.9?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜