summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/envutil.rb8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c90c50611b..8118579176 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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