mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_object.rb: new tests to achieve over 90% test
coverage of object.c, eval.c and eval_method.c. * test/ruby/test_module.rb: ditto. * test/ruby/test_trace.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_method.rb: ditto. * test/ruby/test_variable.rb: ditto. * test/ruby/test_eval.rb: ditto. * test/ruby/test_exception.rb: ditto. * test/ruby/test_class.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e4f8e61ddd
commit
f09f597422
11 changed files with 882 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
require 'test/unit'
|
||||
require_relative 'envutil'
|
||||
|
||||
class TestMethod < Test::Unit::TestCase
|
||||
def setup
|
||||
|
@ -10,6 +11,10 @@ class TestMethod < Test::Unit::TestCase
|
|||
$VERBOSE = @verbose
|
||||
end
|
||||
|
||||
def ruby(*r, &b)
|
||||
EnvUtil.rubyexec(*r, &b)
|
||||
end
|
||||
|
||||
def m0() end
|
||||
def m1(a) end
|
||||
def m2(a, b) end
|
||||
|
@ -202,4 +207,17 @@ class TestMethod < Test::Unit::TestCase
|
|||
m2 = c2.new.method(:foo)
|
||||
assert_equal("#<Method: #{ c2.inspect }(#{ c.inspect })#foo>", m2.inspect)
|
||||
end
|
||||
|
||||
def test_callee_top_level
|
||||
ruby do |w, r, e|
|
||||
w.puts "p __callee__"
|
||||
w.close
|
||||
assert_equal("nil", r.read.chomp)
|
||||
assert_match("", e.read.chomp)
|
||||
end
|
||||
end
|
||||
|
||||
def test_caller_negative_level
|
||||
assert_raise(ArgumentError) { caller(-1) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue