Skip to content

Commit

Permalink
rolled out change 19608... not 1.8 compatible.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ryan committed Sep 30, 2008
1 parent 53cde0c commit 79308b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,7 @@ Tue Sep 30 13:04:11 2008 Ryan Davis <ryan@wrath.local>

* lib/mini/test.rb: Updated to 1.3.0 r4255.
* test/mini/*: added from r4255.
* lib/mini/test.rb: rolled out change 19608... not 1.8 compatible.

Tue Sep 30 07:46:07 2008 Eric Hodel <drbrain@segment7.net>

Expand Down
16 changes: 13 additions & 3 deletions lib/mini/test.rb
Expand Up @@ -14,18 +14,28 @@ module Mini
class Assertion < Exception; end
class Skip < Assertion; end

MINI_DIR = File.expand_path("../..", __FILE__)
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))

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?

Expand Down

0 comments on commit 79308b7

Please sign in to comment.