Skip to content

Commit

Permalink
+ Make options accesor lazy.
Browse files Browse the repository at this point in the history
+ Do not filter backtrace if $DEBUG
[git-p4: depot-paths = "//src/minitest/dev/": change = 6056]
  • Loading branch information
zenspider committed Dec 12, 2010
1 parent 9889cb7 commit 65f238c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions lib/minitest/unit.rb
Expand Up @@ -37,13 +37,19 @@ def self.filter_backtrace bt # :nodoc:
return ["No backtrace"] unless bt

new_bt = []
bt.each do |line|
break if line.rindex MINI_DIR, 0
new_bt << line

unless $DEBUG then
bt.each do |line|
break if line.rindex MINI_DIR, 0
new_bt << line
end

new_bt = bt.reject { |line| line.rindex MINI_DIR, 0 } if new_bt.empty?
new_bt = bt.dup if new_bt.empty?
else
new_bt = bt.dup
end

new_bt = bt.reject { |line| line.rindex MINI_DIR, 0 } if new_bt.empty?
new_bt = bt.dup if new_bt.empty?
new_bt
end

Expand Down Expand Up @@ -513,9 +519,13 @@ class Unit
attr_accessor :report, :failures, :errors, :skips # :nodoc:
attr_accessor :test_count, :assertion_count # :nodoc:
attr_accessor :start_time # :nodoc:
attr_accessor :options # :nodoc:
attr_accessor :help # :nodoc:
attr_accessor :verbose # :nodoc:
attr_writer :options # :nodoc:

def options
@options ||= {}
end

@@installed_at_exit ||= false
@@out = $stdout
Expand Down

0 comments on commit 65f238c

Please sign in to comment.