mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err): new
method. * test/ruby/test_argf.rb: use assert_in_out_err instead of EnvUtil.rubyexec. * test/ruby/test_module.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_objectspace.rb: ditto. * test/ruby/test_object.rb: ditto. * test/ruby/test_string.rb: ditto. * test/ruby/test_method.rb: ditto. * test/ruby/test_variable.rb: ditto. * test/ruby/test_io.rb: ditto. * test/ruby/test_rubyoptions.rb: ditto. * test/ruby/test_exception.rb: ditto. * test/ruby/test_class.rb: ditto. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e74af2cf41
commit
eafe85f603
15 changed files with 568 additions and 869 deletions
|
@ -56,16 +56,12 @@ End
|
|||
end
|
||||
|
||||
def test_finalizer
|
||||
EnvUtil.rubyexec("-e", <<-END) do |w, r, e|
|
||||
assert_in_out_err(["-e", <<-END], "", %w(:ok :ok :ok :ok), [])
|
||||
a = []
|
||||
ObjectSpace.define_finalizer(a) { p :ok }
|
||||
b = a.dup
|
||||
ObjectSpace.define_finalizer(a) { p :ok }
|
||||
END
|
||||
assert_equal("", e.read)
|
||||
assert_equal(":ok\n:ok\n:ok\n:ok\n", r.read)
|
||||
|
||||
assert_raise(ArgumentError) { ObjectSpace.define_finalizer([], Object.new) }
|
||||
end
|
||||
assert_raise(ArgumentError) { ObjectSpace.define_finalizer([], Object.new) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue