Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 72 lines (54 sloc) 1.718 kb
db045db @dhh Initial
dhh authored
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/packagetask'
4 require 'rake/gempackagetask'
5
6 desc "Default Task"
a9f5f4b @josh Don't force test suite to use bundler
josh authored
7 task :default => :test
ddb4600 @wycats Get ActionPack's test running on bundled gems. This should make running ...
wycats authored
8
db045db @dhh Initial
dhh authored
9 # Run the unit tests
10
d8fffe7 @lifo Replace ad hoc Rack::Test with ActionController::IntegrationTest
lifo authored
11 desc "Run all unit tests"
d5cfc72 @josh Merge "test_new_base" runner into standard "test_action_pack"
josh authored
12 task :test => [:test_action_pack, :test_active_record_integration]
070f3fd @jeremy Clean up and run the Active Record integration tests by default.
jeremy authored
13
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
14 Rake::TestTask.new(:test_action_pack) do |t|
6d214c9 @josh Merge abstract_controller/test_helper and new_base/test_helper since the...
josh authored
15 t.libs << 'test'
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
16
17 # make sure we include the tests in alphabetical order as on some systems
18 # this will not happen automatically and the tests (as a whole) will error
75a2f00 @josh Move improved isolated test runner to AP
josh authored
19 t.test_files = Dir.glob('test/{abstract,controller,dispatch,template}/**/*_test.rb').sort
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
20
762d761 @josh All tests should be ran under isolated_test too
josh authored
21 # t.warning = true
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
22 end
86fc43f ActionPack components should no longer have undeclared dependencies.
Yehuda Katz + Carl Lerche authored
23
75a2f00 @josh Move improved isolated test runner to AP
josh authored
24 namespace :test do
25 Rake::TestTask.new(:isolated) do |t|
26 t.pattern = 'test/ts_isolated.rb'
27 end
fa5da8a @jeremy isolated_test task
jeremy authored
28 end
db045db @dhh Initial
dhh authored
29
d49a5fc @NZKoz * Fix pagination problems when using include
NZKoz authored
30 desc 'ActiveRecord Integration Tests'
31 Rake::TestTask.new(:test_active_record_integration) do |t|
6d214c9 @josh Merge abstract_controller/test_helper and new_base/test_helper since the...
josh authored
32 t.libs << 'test'
d49a5fc @NZKoz * Fix pagination problems when using include
NZKoz authored
33 t.test_files = Dir.glob("test/activerecord/*_test.rb")
34 end
35
f430d6b @josh Make gemspecs the authoritative source instead of generating them from t...
josh authored
36 spec = eval(File.read('actionpack.gemspec'))
37
db045db @dhh Initial
dhh authored
38 Rake::GemPackageTask.new(spec) do |p|
39 p.gem_spec = spec
40 end
41
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
42 desc "Release to gemcutter"
459ecaf @jeremy Submarine the rake-gemcutter dep in Rakefiles
jeremy authored
43 task :release => :package do
44 require 'rake/gemcutter'
45 Rake::Gemcutter::Tasks.new(spec).define
46 Rake::Task['gem:push'].invoke
47 end
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
48
e0a2dab @dhh Added KLOC counter for AR and AP. Combined theyre at ~9KLOC
dhh authored
49 task :lines do
50 lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
51
52 for file_name in FileList["lib/**/*.rb"]
53 next if file_name =~ /vendor/
54 f = File.open(file_name)
55
56 while line = f.gets
57 lines += 1
58 next if line =~ /^\s*$/
59 next if line =~ /^\s*#/
60 codelines += 1
61 end
62 puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
6094e65 @josh We won't be publishing tars and zips anymore
josh authored
63
e0a2dab @dhh Added KLOC counter for AR and AP. Combined theyre at ~9KLOC
dhh authored
64 total_lines += lines
65 total_codelines += codelines
6094e65 @josh We won't be publishing tars and zips anymore
josh authored
66
e0a2dab @dhh Added KLOC counter for AR and AP. Combined theyre at ~9KLOC
dhh authored
67 lines, codelines = 0, 0
68 end
69
70 puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
b378b19 @spastorino Makes Rakefile activate rdoc >= 2.5.9
spastorino authored
71 end
Something went wrong with that request. Please try again.