# What is the minitest equivalent of assert\_nothing\_raised?

**URL:** <https://www.ruby-forum.com/t/what-is-the-minitest-equivalent-of-assert-nothing-raised/199421>\
**Category:** Ruby\
**Created:** [November 20, 2010, 11:36pm UTC](https://www.ruby-forum.com/t/what-is-the-minitest-equivalent-of-assert-nothing-raised/199421 "2010-11-20T23:36:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [November 20, 2010, 11:36pm UTC](https://www.ruby-forum.com/t/what-is-the-minitest-equivalent-of-assert-nothing-raised/199421/1 "2010-11-20T23:36:10Z")

</div>

Though it was in the test/unit module for 1.8, 1.9’s minitest module  
seems to lack an assert\_nothing\_raised method. That is kind of  
frustrating. I’ll give 10 thank-yous to the first person who knows how  
to write a minitest compatible test for what in Test::Unit looked  
like:

def test\_no\_error\_is\_raised  
assert\_nothing\_raised do  
method\_whatever(\*args)  
end  
end

Thanks (that one is free),  
Tim

---

<div class="post-metadata">

**Author:** ![timr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@timr](https://www.ruby-forum.com/u/timr)\
**Post date:** [November 21, 2010, 4:52am UTC](https://www.ruby-forum.com/t/what-is-the-minitest-equivalent-of-assert-nothing-raised/199421/2 "2010-11-21T04:52:49Z")

</div>

Hi,

On Nov 20, 2010, at 2:35 PM, timr wrote:

> Though it was in the test/unit module for 1.8, 1.9’s minitest module  
> seems to lack an assert\_nothing\_raised method.

It was removed because it’s not useful enough. Test the proper behavior  
of your method, not the fact that it doesn’t raise an exception.

---

<div class="post-metadata">

**Author:** ![timr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@timr](https://www.ruby-forum.com/u/timr)\
**Post date:** [November 21, 2010, 5:16am UTC](https://www.ruby-forum.com/t/what-is-the-minitest-equivalent-of-assert-nothing-raised/199421/3 "2010-11-21T05:16:01Z")

</div>

10.times{puts “Thanks John”}  
Tim
