MiniTest

Hi,

I am relatively new to Ruby and I couldn’t make MiniTest to execute the
test.

The code I am trying to is as follows

Require the win32ole library:loade

require ‘rubygems’
require ‘win32ole’
require ‘minitest/unit’
MiniTest::Unit.autorun

class RubyTest < MiniTest::Unit::TestCase
def setup
@wsh = WIN32OLE.new(‘Wscript.Shell’)
end
def testIsActive
if @wsh.AppActivate(‘Notepad’)
assert(true, ‘This unit test got passed.’)
puts ‘This unit test got passed.’
else
assert(false, ‘This unit test did NOT get passed.’)
end
end
def teardown
end
end

The file containing the above code loads fine, but does not execute the
test.
I am loading the file from iteractive Ruby window.

However , if I press ^C in the interactive Ruby window (After loading
the file) , the test case starts excecuting

Can some one point to me why the same is not working?

Regards,
George

On Sep 16, 2009, at 22:00 , George T. wrote:

Hi,

I am relatively new to Ruby and I couldn’t make MiniTest to execute
the
test.

The code I am trying to is as follows

The file containing the above code loads fine, but does not execute
the
test.
I am loading the file from iteractive Ruby window.

However , if I press ^C in the interactive Ruby window (After loading
the file) , the test case starts excecuting

Can some one point to me why the same is not working?

unit tests are not run via irb. they’re run from the commandline:

ruby -Ilib test/test_blah.rb

Both test/unit and minitest both rely on executing via the at_exit
mechanism, so you’re loading the tests, but they don’t run until you
leave irb.

Thanks. Its working now

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs