ANN: assert_raise_message

P

Phlip

Rubies:

I don't like assert_raise because the first thing I wanted to check was the
e.message was correct. So I wrote assert_raise_message, and wrote that up
as a tutorial on how to use assert_raise in general:

http://www.oreillynet.com/onlamp/blog/2007/07/assert_raise_on_ruby_dont_just.html

AKA: http://tinyurl.com/23tlu5

assert_raise_message works great for test-firsting new assertions, because
assertions should have comprehensive (and comprehensible) diagnostics. All
new assertions should come with tests that they raise the correct messages.
 
J

James Edward Gray II

I don't like assert_raise because the first thing I wanted to check
was the
e.message was correct.

message = assert_raise ... do
...
end
assert_equals(..., message)

James Edward Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,312
Members
47,988
Latest member
HarryBeck

Latest Threads

Top