summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/mini/test.rb16
2 files changed, 7 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a9cabdb0..72a13adb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Sep 28 18:39:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mini/test.rb (MINI_DIR): loaded path is expanded.
+
Sun Sep 28 12:36:09 2008 Koichi Sasada <ko1@atdot.net>
* vm_exec.c (vm_exec_core): add an UNLIKELY() hint.
diff --git a/lib/mini/test.rb b/lib/mini/test.rb
index e08d4dd93..a8a65821a 100644
--- a/lib/mini/test.rb
+++ b/lib/mini/test.rb
@@ -13,28 +13,18 @@
module Mini
class Assertion < Exception; end
- file = if __FILE__ =~ /^[^\.]/ then # OMG ruby 1.9 is so lame (rubinius too)
- require 'pathname'
- pwd = Pathname.new(Dir.pwd)
- pn = Pathname.new(File.expand_path(__FILE__))
- pn = File.join(".", pn.relative_path_from(pwd)) unless pn.relative?
- pn.to_s
- else
- __FILE__
- end
-
- MINI_DIR = File.dirname(File.dirname(file))
+ MINI_DIR = File.expand_path("../..", __FILE__)
def self.filter_backtrace bt
return ["No backtrace"] unless bt
new_bt = []
bt.each do |line|
- break if line.index(MINI_DIR) == 0
+ break if line.index(MINI_DIR, 0)
new_bt << line
end
- new_bt = bt.reject { |line| line.index(MINI_DIR) == 0 } if
+ new_bt = bt.reject { |line| line.index(MINI_DIR, 0) } if
new_bt.empty?
new_bt = bt.dup if new_bt.empty?