Skip to content

Commit

Permalink
Add Rake task that detects spec groups intereference
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed May 4, 2008
1 parent 1a1b84b commit caa9bd3
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions Rakefile
Expand Up @@ -6,7 +6,7 @@ require 'strokedb'; require 'core_ext'
require 'task/echoe'
Echoe.taskify do
Dir['task/**/*.task'].each {|t| load t}

namespace :echoe do
Echoe.new('strokedb', StrokeDB::VERSION) do |g|
g.author = ['Yurii Rashkovskii', 'Oleg Andreev']
Expand All @@ -19,30 +19,30 @@ Echoe.taskify do
time), it scales infinitely, it even allows free versioning and integrates
perfectly with Ruby applications.
EOF

g.platform = Gem::Platform::RUBY
g.dependencies = ['diff-lcs >= 1.1.2', 'uuidtools >= 1.0.3', 'json >= 1.1.2']

g.manifest_name = 'meta/MANIFEST'
g.ignore_pattern = /(^\.git|^.DS_Store$|^meta|^test\/storages|^examples\/(.*).strokedb|^bugs)/
g.executable_pattern = 'bin/strokedb'
end

desc 'tests packaged files to ensure they are all present'
task :verify => :package do
# An error message will be displayed if files are missing
if system %(ruby -e "require 'rubygems'; require 'pkg/strokedb-#{StrokeDB::VERSION}/strokedb'")
puts "\nThe library files are present"
end
end

desc 'Clean tree, update manifest, and install gem'
task :magic => [:clean, :manifest, :install]
end

desc 'Check what\'s up in this mug'
task :sup => [:'rcov:run', :'rcov:verify']

# Developers: Run this before commiting!
desc 'Check everything over before commiting!'
task :aok => [:'rcov:verbose', :'rcov:strict', :'rcov:open',
Expand All @@ -57,4 +57,29 @@ task :cruise => [:'ditz:html', :'rdoc:html', :'rcov:bw', :'rcov:verify']
task :default => :list
task :list do
system 'rake -T'
end
end


desc "Detects interfering spec group pairs. By Michael Klishin."
task :interfers do
file = ENV['SPECFILE']

all_specs = Dir.glob(File.dirname(__FILE__) + "/spec/**/*_spec.rb") - [File.expand_path(file)]
all_specs.each do |specfile|
pair = "#{specfile} #{file}"
output = `spec -c #{pair}`

if output =~ /0\sfailures/
print "."
STDOUT.flush
else
puts "\n\nACHTUNG! Coupled spec groups detected! Fuck! Shit! You should have this fixed ASAP! AAAAA!!!"
puts "spec -c #{pair}"
puts "Run says \n\n"
puts output
end
end

puts
puts
end

0 comments on commit caa9bd3

Please sign in to comment.