diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-03 01:37:50 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-03 01:37:50 +0000 |
commit | 805b08f2925f5ceec67bf472e76e869bbddc8c39 (patch) | |
tree | 95071dbe2bf00ba5d91d7c0e3c0c137ec9d32265 /test/ruby/test_method.rb | |
parent | d2fd7f32c8f4b134dc6716903be3be0f6c67760b (diff) | |
download | ruby-805b08f2925f5ceec67bf472e76e869bbddc8c39.tar.gz |
* eval.c (f_current_dirname): add the new method for Kernel.
This method almotst same as File.dirname(__FILE__). One
different behavior is it returns nil when __FILE__ returns nil.
[Feature #3346]
* NEWS: ditto
* test/ruby/test_method.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r-- | test/ruby/test_method.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 6a5a75cf20..a1572fde5e 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -489,4 +489,9 @@ class TestMethod < Test::Unit::TestCase 1000.times {p = Bug6171.new('test'); 10000.times {p.reverse}} EOC end + + def test___dir__ + assert_instance_of String, __dir__ + assert_equal(File.dirname(__FILE__), __dir__) + end end |