mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
marshaltestlib.rb: use clean object for exception
* test/ruby/marshaltestlib.rb (test_exception): use separate clean object to raise an exception. TestCase instance often has modules included. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aa2b32ae4b
commit
2e501b0a8b
1 changed files with 3 additions and 1 deletions
|
@ -110,7 +110,9 @@ module MarshalTestLib
|
||||||
class MyException < Exception; def initialize(v, *args) super(*args); @v = v; end; attr_reader :v; end
|
class MyException < Exception; def initialize(v, *args) super(*args); @v = v; end; attr_reader :v; end
|
||||||
def test_exception
|
def test_exception
|
||||||
marshal_equal(Exception.new('foo')) {|o| o.message}
|
marshal_equal(Exception.new('foo')) {|o| o.message}
|
||||||
marshal_equal(assert_raise(NoMethodError) {no_such_method()}) {|o| o.message}
|
obj = Object.new
|
||||||
|
e = assert_raise(NoMethodError) {obj.no_such_method()}
|
||||||
|
marshal_equal(e) {|o| o.message}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exception_subclass
|
def test_exception_subclass
|
||||||
|
|
Loading…
Reference in a new issue