diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-14 05:59:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-14 05:59:17 +0000 |
commit | c97dc42bb0c7e4843639895c62ef3d5012632b9b (patch) | |
tree | a64052433226f6bedd70f8de078e0175894ba66a /test | |
parent | 2bd5113c8c91977c231dc5f806d0396c4ea0b3f8 (diff) | |
download | ruby-c97dc42bb0c7e4843639895c62ef3d5012632b9b.tar.gz |
envutil.rb: using caller_locations
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
take file and line by using caller_locations if not given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/envutil.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index dcdd857798..6006ae75b4 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -193,8 +193,12 @@ module Test assert(status.success?, m) end - def assert_separately(args, file, line, src) - opt = {} + def assert_separately(args, file = nil, line = nil, src, **opt) + unless file and line + loc, = caller_locations(1,1) + file ||= loc.path + line ||= loc.lineno + end src = <<eom require 'test/unit';include Test::Unit::Assertions;begin;#{src} ensure |