Assert_throws

There's a comment in the docs

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit/A
ssertions.html#M000088

#assert_raises
Alias of assert_raise. Will be deprecated in 1.9, and removed in 2.0.

[Source]

Peter J. Fitzgibbons
Applications Manager
Lakewood Homes - "The American Dream Builder"(r)
Peter.Fitzgibbons@Lakewoodhomes.net
(847) 884-8800

···

-----Original Message-----
From: Eric Hodel [mailto:drbrain@segment7.net]
Sent: Monday, September 12, 2005 3:54 PM
To: ruby-talk ML
Subject: Re: Assert_throws

On 12 Sep 2005, at 12:27, Peter Fitzgibbons wrote:

Ok. I just read assert_raises is deprecated in 1.9 and will be
deleted in 2.0... I guess I was worried for the future and didn't
understand.
Is there extended documentation somewhere on this. The pickaxe
doesn't go into assert_raises/assert_throws.

I don't see it marked as deprecated in 1.9:

$ cat test.rb
require 'test/unit'

class T < Test::Unit::TestCase
   def test_assert_raises
     assert_raises RuntimeError do raise end
   end
end

$ ruby -vw test.rb
ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0] Loaded suite test Started
.
Finished in 0.003145 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

--

FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Then doesn't that just mean that we should be using assert_raise() instead?

James Edward Gray II

···

On Sep 12, 2005, at 4:01 PM, Peter Fitzgibbons wrote:

There's a comment in the docs

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit/A
ssertions.html#M000088

#assert_raises
Alias of assert_raise. Will be deprecated in 1.9, and removed in 2.0.

I would expect this if it had really been deprecated:

$ ruby
require 'cgi-lib'
Warning:-:1: cgi-lib is deprecated after Ruby 1.8.1; use cgi instead

···

On 12 Sep 2005, at 14:01, Peter Fitzgibbons wrote:

There's a comment in the docs

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit/A
ssertions.html#M000088

#assert_raises
Alias of assert_raise. Will be deprecated in 1.9, and removed in 2.0.

[Source]

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Eric Hodel <drbrain@segment7.net> writes:

There's a comment in the docs

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/
Unit/A
ssertions.html#M000088

#assert_raises
Alias of assert_raise. Will be deprecated in 1.9, and removed in 2.0.

[Source]

I would expect this if it had really been deprecated:

$ ruby
require 'cgi-lib'
Warning:-:1: cgi-lib is deprecated after Ruby 1.8.1; use cgi instead

But the docs say it *will* be deprecated in 1.9, not it *is*
deprecated in 1.9, and 1.9 is not final yet. :slight_smile:

It wouldn't hurt to deprecate it soon, though.

···

On 12 Sep 2005, at 14:01, Peter Fitzgibbons wrote:

Eric Hodel

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org