[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

unit testing with ruby1.9.x

John Maclean

3/26/2009 9:08:00 PM

Built ruby from a recent svn. Builds fine and works.

ruby19jx --version
ruby 1.9.2dev (2009-03-18) [i686-linux]

Now for some unit testing;

gem install 'test-unit' --remote

run a test on some code;

ruby19jx proj/code/rb/projects/virt/vz/test/test_vz001.rb
ruby 1.9.2dev (2009-03-18) [i686-linux]
/home/jayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit/autorunner.rb:1:
warning: loading in progress, circular require considered harmful -
/home/jayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit.rb
FE

the autorunner? Am I to `require unit/test2.x` or something?


--
John Maclean
07739 171 531
MSc (DIC)

Timezone: GMT

5 Answers

Eric Hodel

3/26/2009 9:23:00 PM

0

On Mar 26, 2009, at 14:08, john maclean wrote:

> Built ruby from a recent svn. Builds fine and works.
>
> ruby19jx --version
> ruby 1.9.2dev (2009-03-18) [i686-linux]
>
> Now for some unit testing;
>
> gem install 'test-unit' --remote

What's wrong with minitest that ships with 1.9?

John Maclean

3/26/2009 10:06:00 PM

0

2009/3/26 Eric Hodel <drbrain@segment7.net>:
> On Mar 26, 2009, at 14:08, john maclean wrote:
>
>> Built ruby from a recent svn. Builds fine and works.
>>
>> ruby19jx --version
>> ruby 1.9.2dev (2009-03-18) [i686-linux]
>>
>> Now for some unit testing;
>>
>> gem install 'test-unit' --remote
>
> What's wrong with minitest that ships with 1.9?
>
>


Uh, can you point me to some useful docs? Not come across this module
before and I see no obvious docs, (ri or gem server). /me is surprised
about this one!

--
John Maclean
07739 171 531
MSc (DIC)

Timezone: GMT

Eric Hodel

3/26/2009 10:43:00 PM

0

On Mar 26, 2009, at 15:05, john maclean wrote:
> 2009/3/26 Eric Hodel <drbrain@segment7.net>:
>> On Mar 26, 2009, at 14:08, john maclean wrote:
>>
>>> Built ruby from a recent svn. Builds fine and works.
>>>
>>> ruby19jx --version
>>> ruby 1.9.2dev (2009-03-18) [i686-linux]
>>>
>>> Now for some unit testing;
>>>
>>> gem install 'test-unit' --remote
>>
>> What's wrong with minitest that ships with 1.9?
>
> Uh, can you point me to some useful docs? Not come across this module
> before and I see no obvious docs, (ri or gem server). /me is surprised
> about this one!

It's just like 1.8's test unit, but with some changes to the assertions:

$ ri MiniTest::Assertions
-------------------------------------------- Class: MiniTest::Assertions
[no description]
------------------------------------------------------------------------

Instance methods:
_assertions, _assertions=, assert, assert_block, assert_empty,
assert_equal, assert_in_delta, assert_in_epsilon, assert_includes,
assert_instance_of, assert_kind_of, assert_match, assert_nil,
assert_operator, assert_raises, assert_respond_to, assert_same,
assert_send, assert_throws, capture_io, exception_details, flunk,
message, mu_pp, pass, refute, refute_empty, refute_equal,
refute_in_delta, refute_in_epsilon, refute_includes,
refute_instance_of, refute_kind_of, refute_match, refute_nil,
refute_operator, refute_respond_to, refute_same, skip

See also the minitest gem.

Tom Cloyd

3/27/2009 4:03:00 AM

0

john maclean wrote:
> Built ruby from a recent svn. Builds fine and works.
>
> ruby19jx --version
> ruby 1.9.2dev (2009-03-18) [i686-linux]
>
> Now for some unit testing;
>
> gem install 'test-unit' --remote
>
> run a test on some code;
>
> ruby19jx proj/code/rb/projects/virt/vz/test/test_vz001.rb
> ruby 1.9.2dev (2009-03-18) [i686-linux]
> /home/jayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit/autorunner.rb:1:
> warning: loading in progress, circular require considered harmful -
> /home/j> ayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit.rb
> FE
>
> the autorunner? Am I to `require unit/test2.x` or something?
>
>
>
At the risk of stating what is obvious to some and may not be to all,
minitest is now the default testing library supplied with 1.9, replacing
the previously supplied Test::Unit library. I am informed that there one
can easily obtain the same functionality with minitest - but I know
essentially nothing about this, and there seems to be no documentation,
outside of discussion in various books which take up Ruby 1.9. The
library author has said that the code is easy enough to read that that
is good documentation.

Hope this helps.

Tom

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


John Maclean

3/27/2009 2:19:00 PM

0

2009/3/27 Tom Cloyd <tomcloyd@comcast.net>:
> john maclean wrote:
>>
>> Built ruby from a recent svn. Builds fine and works.
>>
>> ruby19jx --version
>> ruby 1.9.2dev (2009-03-18) [i686-linux]
>>
>> Now for some unit testing;
>>
>> gem install 'test-unit' --remote
>>
>> run a test on some code;
>>
>> ruby19jx =A0 =A0proj/code/rb/projects/virt/vz/test/test_vz001.rb
>> ruby 1.9.2dev (2009-03-18) [i686-linux]
>>
>> /home/jayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/u=
nit/autorunner.rb:1:
>> warning: loading in progress, circular require considered harmful -
>> /home/j>> ayeola/ix/lib/ruby19jx/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit.rb
>> FE
>>
>> the autorunner? Am I to `require unit/test2.x` or something?
>>
>>
>>
>
> At the risk of stating what is obvious to some and may not be to all,
> minitest is now the default testing library supplied with 1.9, replacing =
the
> previously supplied Test::Unit library. I am informed that there one can
> easily obtain the same functionality with minitest - but I know essential=
ly
> nothing about this, and there seems to be no documentation, outside of
> discussion in various books which take up Ruby 1.9. The =A0library author=
has
> said that the code is easy enough to read that that is good documentation=