Ben Johnson wrote:> When Im writing tests and I do:
>
> assert_raise RuntimeError, raise("raising")
>
> Then I run the test is says the test failed and I have 1 error:
>
> RuntimeError: hey
>
> Should assert_raise catch that error and say the test passed?
>
> Thanks for your time and help.
I figured it out, you need to pass a block, like:
assert_raise(RuntimeError) { raise("raising") }
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---