Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 73 lines (59 sloc) 2.127 kb
0607826 Added rake test task
tsaleh authored
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
864a35f @rmm5t Added gem related rake tasks [#55]
rmm5t authored
4 require 'rake/gempackagetask'
5 require 'lib/shoulda/context'
6 require 'lib/shoulda/tasks'
0607826 Added rake test task
tsaleh authored
7
9b6dac2 more refactorings
tsaleh authored
8 # Test::Unit::UI::VERBOSE
e1a5426 @rmm5t Added 'rake coverage' for an rcov report
rmm5t authored
9 test_files_pattern = 'test/{unit,functional,other}/**/*_test.rb'
0607826 Added rake test task
tsaleh authored
10 Rake::TestTask.new do |t|
3a8b77d - completely refactored the test system to use a fake rails_root
tsaleh authored
11 t.libs << 'lib'
e1a5426 @rmm5t Added 'rake coverage' for an rcov report
rmm5t authored
12 t.pattern = test_files_pattern
9b6dac2 more refactorings
tsaleh authored
13 t.verbose = false
0607826 Added rake test task
tsaleh authored
14 end
15
1ecd029 - documentation
tsaleh authored
16 Rake::RDocTask.new { |rdoc|
17 rdoc.rdoc_dir = 'doc'
e9eba10 documentation and fixes to :through test
tsaleh authored
18 rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
1ecd029 - documentation
tsaleh authored
19 rdoc.options << '--line-numbers' << '--inline-source'
20 rdoc.template = "#{ENV['template']}.rb" if ENV['template']
5e42226 fixed order of doc files
Tammer Saleh authored
21 rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
1ecd029 - documentation
tsaleh authored
22 }
23
e1a5426 @rmm5t Added 'rake coverage' for an rcov report
rmm5t authored
24 desc "Run code-coverage analysis using rcov"
25 task :coverage do
26 rm_rf "coverage"
27 files = Dir[test_files_pattern]
28 system "rcov --rails --sort coverage -Ilib #{files.join(' ')}"
29 end
30
037e9c8 Added task to sync docs to dev.thoughtbot.com
tsaleh authored
31 desc 'Update documentation on website'
32 task :sync_docs => 'rdoc' do
33 `rsync -ave ssh doc/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/shoulda`
34 end
35
0607826 Added rake test task
tsaleh authored
36 desc 'Default: run tests.'
37 task :default => ['test']
4b39f00 - moved rake tasks to shoulda namespace
tsaleh authored
38
864a35f @rmm5t Added gem related rake tasks [#55]
rmm5t authored
39 spec = Gem::Specification.new do |s|
40 s.name = "shoulda"
41 s.version = Thoughtbot::Shoulda::VERSION
42 s.summary = "Making tests easy on the fingers and eyes"
43 s.homepage = "http://thoughtbot.com/projects/shoulda"
44 s.rubyforge_project = "shoulda"
45
46 s.files = FileList["[A-Z]*", "{bin,lib,test}/**/*"]
47 s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
4b39f00 - moved rake tasks to shoulda namespace
tsaleh authored
48
864a35f @rmm5t Added gem related rake tasks [#55]
rmm5t authored
49 s.has_rdoc = true
50 s.extra_rdoc_files = ["README.rdoc", "CONTRIBUTION_GUIDELINES.rdoc"]
51 s.rdoc_options = ["--line-numbers", "--inline-source", "--main", "README.rdoc"]
52
53 s.authors = ["Tammer Saleh"]
54 s.email = "tsaleh@thoughtbot.com"
55
56 s.add_dependency "activesupport", ">= 2.0"
57 end
58
59 Rake::GemPackageTask.new spec do |pkg|
60 pkg.need_tar = true
61 pkg.need_zip = true
62 end
63
64 desc "Clean files generated by rake tasks"
65 task :clobber => [:clobber_rdoc, :clobber_package]
66
67 desc "Generate a gemspec file for GitHub"
68 task :gemspec do
69 File.open("#{spec.name}.gemspec", 'w') do |f|
70 f.write spec.to_ruby
71 end
72 end
Something went wrong with that request. Please try again.