public
Fork of thoughtbot/shoulda
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thechrisoshow/shoulda.git
bjhess (author)
Fri Oct 17 07:53:43 -0700 2008
rmm5t (committer)
Fri Nov 07 12:30:07 -0800 2008
commit  d06e0207244b5f23e62199aa691619136900358d
tree    cd7b7c70d33c88f676e7d0a6776d208973840539
parent  48a9202b9338b734fc77910fc85e535785843bac
shoulda / Rakefile
100644 73 lines (59 sloc) 2.133 kb
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'lib/shoulda/context'
load 'tasks/shoulda.rake'
 
# Test::Unit::UI::VERBOSE
test_files_pattern = 'test/{unit,functional,other}/**/*_test.rb'
Rake::TestTask.new do |t|
  t.libs << 'lib'
  t.pattern = test_files_pattern
  t.verbose = false
end
 
Rake::RDocTask.new { |rdoc|
  rdoc.rdoc_dir = 'doc'
  rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
  rdoc.options << '--line-numbers' << '--inline-source'
  rdoc.template = "#{ENV['template']}.rb" if ENV['template']
  rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
}
 
desc "Run code-coverage analysis using rcov"
task :coverage do
  rm_rf "coverage"
  files = Dir[test_files_pattern]
  system "rcov --rails --sort coverage -Ilib #{files.join(' ')}"
end
 
desc 'Update documentation on website'
task :sync_docs => 'rdoc' do
  `rsync -ave ssh doc/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/shoulda`
end
 
desc 'Default: run tests.'
task :default => ['test']
 
spec = Gem::Specification.new do |s|
  s.name = "shoulda"
  s.version = Thoughtbot::Shoulda::VERSION
  s.summary = "Making tests easy on the fingers and eyes"
  s.homepage = "http://thoughtbot.com/projects/shoulda"
  s.rubyforge_project = "shoulda"
 
  s.files = FileList["[A-Z]*", "{bin,lib,rails,test}/**/*"]
  s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
 
  s.has_rdoc = true
  s.extra_rdoc_files = ["README.rdoc", "CONTRIBUTION_GUIDELINES.rdoc"]
  s.rdoc_options = ["--line-numbers", "--inline-source", "--main", "README.rdoc"]
 
  s.authors = ["Tammer Saleh"]
  s.email = "tsaleh@thoughtbot.com"
 
  s.add_dependency "activesupport", ">= 2.0.0"
end
 
Rake::GemPackageTask.new spec do |pkg|
  pkg.need_tar = true
  pkg.need_zip = true
end
 
desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rdoc, :clobber_package]
 
desc "Generate a gemspec file for GitHub"
task :gemspec do
  File.open("#{spec.name}.gemspec", 'w') do |f|
    f.write spec.to_ruby
  end
end