diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/envutil.rb | 8 |
2 files changed, 10 insertions, 3 deletions
@@ -1,4 +1,7 @@ -Fri Dec 14 14:58:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> +Fri Dec 14 14:59:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately): + take file and line by using caller_locations if not given. * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately): count assertions in separated tests. 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 |