# Getting fox unit test runner to work

**URL:** <https://www.ruby-forum.com/t/getting-fox-unit-test-runner-to-work/193932>\
**Category:** Ruby\
**Created:** [August 26, 2010, 7:20pm UTC](https://www.ruby-forum.com/t/getting-fox-unit-test-runner-to-work/193932 "2010-08-26T19:20:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fourchette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ac91a4/32.png) [@fourchette](https://www.ruby-forum.com/u/fourchette)\
**Post date:** [August 26, 2010, 7:20pm UTC](https://www.ruby-forum.com/t/getting-fox-unit-test-runner-to-work/193932/1 "2010-08-26T19:20:05Z")

</div>

hi there,

sorry if the question seems dump but…

i have some unit tests that just work great

$ test/ILV\_unittest.rb  
Loaded suite test/ILV\_unittest  
Started  
…  
Finished in 0.060136 seconds.

24 tests, 141 assertions, 0 failures, 0 errors  
$

they work both in ubuntu 10 and cygwin (windows XP). i’m happy with  
this.

reading the doc I could see that there was supposed to be some way to  
have the whoole thing handled by a nicer UI.

indeed :

$ test/ILV\_unittest.rb --help  
Test::Unit automatic runner.  
Usage: test/ILV\_unittest.rb [options] [-- untouched arguments]

```
-r, --runner=RUNNER Use the given RUNNER.
                                 (c[onsole], f[ox], g[tk], g[tk]2,

```

t[k])  
-n, --name=NAME Runs tests matching NAME.  
(patterns may be used).  
-t, --testcase=TESTCASE Runs tests in TestCases matching  
TESTCASE.  
(patterns may be used).  
-I, --load-path=DIR[:DIR…] Appends directory list to  
$LOAD\_PATH.  
-v, --verbose=[LEVEL] Set the output level (default is  
verbose).  
(s[ilent], p[rogress], n[ormal],  
v[erbose])  
– Stop processing options so that the  
remaining options will be passed to  
the  
test.  
-h, --help Display this help.

Deprecated options:  
–console Console runner (use --runner).  
–gtk GTK runner (use --runner).  
–fox Fox runner (use --runner).

so --runner=fox should do the trick. However :

$ test/ILV\_unittest.rb --runner=fox  
/usr/lib/ruby/1.8/test/unit/ui/fox/testrunner.rb:7:in `require': no such file to load -- fox (LoadError) from /usr/lib/ruby/1.8/test/unit/ui/fox/testrunner.rb:7 from /usr/lib/ruby/1.8/test/unit/autorunner.rb:37:in `require’  
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:37  
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in `[]' from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in `run’  
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' from /usr/lib/ruby/1.8/test/unit.rb:279 from test/ILV_unittest.rb:227 $ test/ILV_unittest.rb --runner=gtk /usr/lib/ruby/1.8/test/unit/ui/gtk/testrunner.rb:7:in `require’: no such  
file to load – gtk (LoadError)  
from /usr/lib/ruby/1.8/test/unit/ui/gtk/testrunner.rb:7  
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:29:in `require' from /usr/lib/ruby/1.8/test/unit/autorunner.rb:29 from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in `[]’  
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in `run' from /usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run’  
from /usr/lib/ruby/1.8/test/unit.rb:279  
from test/ILV\_unittest.rb:227  
alexis@mtb-ubuntu-vdesk:/media/share\_mes\_projets/MATester\_RB$  
test/ILV\_unittest.rb --runner=console  
Loaded suite test/ILV\_unittest  
Started  
…  
Finished in 0.059887 seconds.

24 tests, 141 assertions, 0 failures, 0 errors  
$ gem env  
RubyGems Environment:

- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-linux

- GEM PATHS:
  - /var/lib/gems/1.8
  - /home/alexis/.gem/ruby/1.8

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://gems.rubyforge.org/](http://gems.rubyforge.org/)

$ gem list

\*\*\* LOCAL GEMS \*\*\*

fxruby (1.6.20)  
hoe (2.6.1)  
json\_pure (1.4.6)  
rake (0.8.7)  
redcar (0.3.8.4)  
rubyforge (2.0.4)  
rubyzip (0.9.4)  
test-unit (2.1.1)  
test-unit-full (0.0.2)  
test-unit-notify (0.0.1)  
test-unit-runner-fox (0.0.1)  
test-unit-runner-gtk2 (0.0.1)  
test-unit-runner-tk (0.0.1)

$

It should be mentioned that I tried under cygwin first (but compiled Fox  
lib failed unfortuantely so the fwruby gem would not install at all).  
thus the reason why i tried with ubuntu just in case.  
the weird thing is that i can have the fxruby example working on the  
very same Ubuntu setup…  
out of the blue i tried with gtk libs  
==\> faced same error see above  
and out of ideas, i saw some test-unit-runner-fox (the 0.0.1 wasn’t very  
appealing but since nothing was working…). i tried with  
test-unit-runner-gtk but no luck

i’m out of ideas

anyone knows how i can get a unit test to be run with fox ? (or gtk)  
basically with another runner than console?

thanks

---

<div class="post-metadata">

**Author:** ![fourchette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ac91a4/32.png) [@fourchette](https://www.ruby-forum.com/u/fourchette)\
**Post date:** [August 27, 2010, 8:42am UTC](https://www.ruby-forum.com/t/getting-fox-unit-test-runner-to-work/193932/2 "2010-08-27T08:42:01Z")

</div>

On Aug 26, 2010, at 10:20 , Fourchette Fourchette wrote:

> Finished in 0.060136 seconds.

Look at that number. Embrace it. Love it. But, please, don’t ruin it by  
adding some silly GUI.

---

<div class="post-metadata">

**Author:** ![fourchette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ac91a4/32.png) [@fourchette](https://www.ruby-forum.com/u/fourchette)\
**Post date:** [August 27, 2010, 9:29am UTC](https://www.ruby-forum.com/t/getting-fox-unit-test-runner-to-work/193932/3 "2010-08-27T09:29:30Z")

</div>

Ryan D. wrote:

> On Aug 26, 2010, at 10:20 , Fourchette Fourchette wrote:
> 
> > Finished in 0.060136 seconds.
> 
> Look at that number. Embrace it. Love it. But, please, don’t ruin it by  
> adding some silly GUI.

i couldn’t agree more

but sometimes paying clients like to “see” things so they continue to  
believe that by paying you they’re dealing with the best. (obviously  
it’s not true, i can barely evaluate the immensity of my own ignorance,  
but what matters is what the guys paying think of us when they sign  
checks)

so anyway, i figured it would be nice to have the test units being run  
by scripts, and occasionally during meetings or presentations with  
clients show something more sexy without having to endure the  
development of the sexy GUI myself.

so i figured maybe --runner=fox was worth trying.

i hope this clarify things 🙂

alex

ps : i also saw the cucumber/rspec output which is really professional  
looking  
[http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber\_full.jpg](http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber_full.jpg)  
so i’ll definitely look into this once i’m more familiar with rspec and  
unit testing in ruby in general.

---

<div class="post-metadata">

**Author:** ![fourchette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ac91a4/32.png) [@fourchette](https://www.ruby-forum.com/u/fourchette)\
**Post date:** [August 27, 2010, 10:54am UTC](https://www.ruby-forum.com/t/getting-fox-unit-test-runner-to-work/193932/4 "2010-08-27T10:54:55Z")

</div>

On Aug 27, 2010, at 00:29 , Fourchette Fourchette wrote:

> but sometimes paying clients like to “see” things so they continue to  
> believe that by paying you they’re dealing with the best. (obviously  
> it’s not true, i can barely evaluate the immensity of my own ignorance,  
> but what matters is what the guys paying think of us when they sign  
> checks)

I’d look at the Hudson continuous integration system instead. Very nice  
UI with historical graphs of progress (# of tests, test results) over  
time. Plus it is always nice to have it watching your back.
