diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-14 12:52:17 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-14 12:52:17 +0000 |
commit | f09f597422b4130727638e41b1332edac1514642 (patch) | |
tree | 6a4ea2196159042da8c2751244d3e612d335217e /test/ruby/test_method.rb | |
parent | e4f8e61dddb18f29fe71392a464f87b612d7eb5c (diff) | |
download | ruby-f09f597422b4130727638e41b1332edac1514642.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r-- | test/ruby/test_method.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index f4055e7950..df0ec792f3 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -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 |