如何在Windows上使用Eclipse在Ruby中实现TDD

如何在Windows上使用Eclipse在Ruby中实现TDD,ruby,windows,eclipse,tdd,Ruby,Windows,Eclipse,Tdd,如何在Windows上使用Eclipse在Ruby中对以下代码段进行TDD class PassIntegers def addition(i,j) k = i+j end end 通过执行gem安装测试单元安装测试单元 以2 Ruby Test require 'test/unit' require 'PassIntegers' class TestPassIntegers < Test::Unit::TestCase def test_pass_intege

如何在Windows上使用Eclipse在Ruby中对以下代码段进行TDD

class PassIntegers
  def addition(i,j)
    k = i+j
  end
end

通过执行
gem安装测试单元安装测试单元

2 Ruby Test

require 'test/unit'

require 'PassIntegers'
class TestPassIntegers < Test::Unit::TestCase
    def test_pass_integers
      passIntegers = PassIntegers.new
      expected = passIntegers.addition 3,2
      assert_equal expected, 5
    end
end
及加入

autoRunner.runner_options[:output_level] = Test::Unit::UI::Console::OutputLevel::SILENT
然后再次运行测试


解决在Windows和Eclipse上发现的未初始化常量测试::Unit::UI::SILENT(NameError)问题的解决方案与此无关。我想开始写一些更容易测试的东西,现在你要么打印,要么修改标准输出。谢谢你的反馈。我已经修改了这个问题。在EclipseMars中,为了修复相同的错误,我注释了第252行(
autoRunner.output\u level=Test::Unit::UI::SILENT
#autoRunner.output_level = Test::Unit::UI::SILENT
autoRunner.runner_options[:output_level] = Test::Unit::UI::Console::OutputLevel::SILENT