diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 09:39:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 09:39:53 +0000 |
commit | 6952b1a52a2bd4757b524173edf7ffa31b98fdf2 (patch) | |
tree | 03fc1f57a577a373bf6234e60d40f62b729bea66 /lib | |
parent | 574027ba0371ab2e6fdb84e0634ec72d02cd6ff7 (diff) | |
download | ruby-6952b1a52a2bd4757b524173edf7ffa31b98fdf2.tar.gz |
* lib/mini/test.rb (MINI_DIR): loaded path is expanded.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mini/test.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/mini/test.rb b/lib/mini/test.rb index e08d4dd93e..a8a65821a5 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? |