jbarnette (owner)

Revisions

gist: 219285 Download_button fork
public
Public Clone URL: git://gist.github.com/219285.git
Embed All Files: show embed
lib/tasks/test.rake #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This could easily be forked to avoid the environment load penalty.
# I don't care, since I only run it periodically. It helps me catch
# sloppy stuff in test files that changes the behavior of others, like
# constant assignments, halfassed/unclosed mocks, or inconsistent requires.
 
namespace :test do
  desc "Show which test files fail when run alone."
  task :deps do
    failures = {}
 
    $stdout.sync = true
 
    Dir["test/**/*_test.rb"].each do |test|
      # FIX: hardcoded ruby, assumes unixish
      ret = `ruby -Itest #{test} 2>&1`
      failures[test] = ret unless $?.success?
      $stdout.print "."
    end
 
    puts
 
    failures.each do |test, ret|
      puts "#{test}:"
      puts ret
      puts
    end
  end
end