Permalink
Browse files

Skip backtrace tests when tmpdir is in the suppressed pattern

Removed duplications in Rake::Backtrace::SUPPRESSED_PATHS
  • Loading branch information...
drbrain committed Nov 30, 2012
1 parent 767f7ed commit fc8c5b6bc7a99d21e33f5c97713ee5578096aeed
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/rake/backtrace.rb
  2. +8 −0 test/test_rake_backtrace.rb
View
@@ -2,7 +2,7 @@ module Rake
module Backtrace
SUPPRESSED_PATHS =
RbConfig::CONFIG.values_at(*RbConfig::CONFIG.
- keys.grep(/(prefix|libdir)/)) + [
+ keys.grep(/(prefix|libdir)/)).uniq + [
File.join(File.dirname(__FILE__), ".."),
].map { |f| Regexp.quote(File.expand_path(f)) }
SUPPRESSED_PATHS.reject! { |s| s.nil? || s =~ /^ *$/ }
@@ -2,6 +2,14 @@
require 'open3'
class TestRakeBacktrace < Rake::TestCase
+
+ def setup
+ super
+
+ skip 'tmpdir is suppressed in backtrace' if
+ Dir.pwd =~ Rake::Backtrace::SUPPRESS_PATTERN
+ end
+
# TODO: factor out similar code in test_rake_functional.rb
def rake(*args)
Open3.popen3(RUBY, "-I", @rake_lib, @rake_exec, *args) { |_, _, err, _|

0 comments on commit fc8c5b6

Please sign in to comment.