# MiniTest

**URL:** <https://www.ruby-forum.com/t/minitest/175657>\
**Category:** Ruby\
**Created:** [September 17, 2009, 6:58am UTC](https://www.ruby-forum.com/t/minitest/175657 "2009-09-17T06:58:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 17, 2009, 6:58am UTC](https://www.ruby-forum.com/t/minitest/175657/1 "2009-09-17T06:58:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 17, 2009, 7:19am UTC](https://www.ruby-forum.com/t/minitest/175657/2 "2009-09-17T07:19:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![george\_thomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@george\_thomas](https://www.ruby-forum.com/u/george_thomas)\
**Post date:** [September 17, 2009, 7:54am UTC](https://www.ruby-forum.com/t/minitest/175657/3 "2009-09-17T07:54:21Z")

</div>

Thanks. Its working now
