# Test/unit and pp

**URL:** <https://www.ruby-forum.com/t/test-unit-and-pp/50031>\
**Category:** Ruby\
**Created:** [December 12, 2005, 1:11pm UTC](https://www.ruby-forum.com/t/test-unit-and-pp/50031 "2005-12-12T13:11:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgundlach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Post date:** [December 12, 2005, 1:11pm UTC](https://www.ruby-forum.com/t/test-unit-and-pp/50031/1 "2005-12-12T13:11:15Z")

</div>

Hi,

given the following program:

* * *

#!/opt/ruby/1.8/bin/ruby -w

require ‘test/unit’

class FooTester \< Test::Unit::TestCase  
def setup  
@foo=Array.new  
@foo \<\< [:a,:b,[:c]]  
end  
def test\_foo  
assert\_instance\_of Hash,@foo  
end  
end

* * *

I’d like to have the

" 1) Failure:  
test\_foo(FooTester) [-:16]:  
\<[[:a, :b, [:c]]]\> expected to be an instance of  
 but was  
."

written a bit shorter, perhaps like this:

" 1) Failure:  
test\_foo(FooTester) [-:16]:  
instance of expected but was ."

because sometimes I have very large objects to compare. I was not  
successful by setting use\_pp=false, somehow there is no difference  
between those two (with and w/o use\_pp=false).

Patrick

---

<div class="post-metadata">

**Author:** ![pgundlach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Post date:** [December 12, 2005, 4:48pm UTC](https://www.ruby-forum.com/t/test-unit-and-pp/50031/2 "2005-12-12T16:48:38Z")

</div>

you should grab unitdiff from the ZenTest package, available at  
[http://rubyforge.org/projects/zentest/](http://rubyforge.org/projects/zentest/)

it will work wonders on cleaning up large amounts of testing feedback.

-pate

---

<div class="post-metadata">

**Author:** ![pgundlach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Post date:** [December 12, 2005, 6:09pm UTC](https://www.ruby-forum.com/t/test-unit-and-pp/50031/3 "2005-12-12T18:09:55Z")

</div>

> you should grab unitdiff from the ZenTest package, available at  
> [http://rubyforge.org/projects/zentest/](http://rubyforge.org/projects/zentest/)
> 
> it will work wonders on cleaning up large amounts of testing feedback.

does it also clean up the messages? Couldn’t find anything in the docs  
about it.

[…]

> > " 1) Failure:  
> > test\_foo(FooTester) [-:16]:  
> > instance of expected but was ."

Patrick

---

<div class="post-metadata">

**Author:** ![pgundlach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Post date:** [December 12, 2005, 6:34pm UTC](https://www.ruby-forum.com/t/test-unit-and-pp/50031/4 "2005-12-12T18:34:00Z")

</div>

On 12/12/05, Patrick G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > you should grab unitdiff from the ZenTest package, available at  
> > [http://rubyforge.org/projects/zentest/](http://rubyforge.org/projects/zentest/)
> > 
> > it will work wonders on cleaning up large amounts of testing feedback.
> 
> does it also clean up the messages? Couldn’t find anything in the docs  
> about it.

Ahh, I misread your request. No it doesn’t clean up the message.

---

<div class="post-metadata">

**Author:** ![pgundlach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Post date:** [December 12, 2005, 8:04pm UTC](https://www.ruby-forum.com/t/test-unit-and-pp/50031/5 "2005-12-12T20:04:20Z")

</div>

On Dec 12, 2005, at 11:07 AM, Patrick G. wrote:

> > you should grab unitdiff from the ZenTest package, available at  
> > [http://rubyforge.org/projects/zentest/](http://rubyforge.org/projects/zentest/)
> > 
> > it will work wonders on cleaning up large amounts of testing  
> > feedback.
> 
> does it also clean up the messages? Couldn’t find anything in the docs  
> about it.

Yes and no. It show’s a diff of the two items that were suppose to  
be equal. This is almost a required feature when working with  
assert\_tag() in Rails, for example.

James Edward G. II
