Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 68 lines (56 sloc) 1.845 kB
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
4
5 desc 'Default: run unit tests.'
6 task :default => :test
7
0128efd Point users to the Lightouse URL
mislav authored
8 desc 'Test the will_paginate plugin.'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
9 Rake::TestTask.new(:test) do |t|
10 t.pattern = 'test/**/*_test.rb'
11 t.verbose = true
1d8a065 @mislav Reduce File.dirname cruft: invoke individual tests with -Ilib:test pa…
authored
12 t.libs << 'test'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
13 end
14
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
15 # I want to specify environment variables at call time
16 class EnvTestTask < Rake::TestTask
17 attr_accessor :env
18
19 def ruby(*args)
20 env.each { |key, value| ENV[key] = value } if env
21 super
22 env.keys.each { |key| ENV.delete key } if env
23 end
24 end
25
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
26 for configuration in %w( sqlite3 mysql postgres )
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
27 EnvTestTask.new("test_#{configuration}") do |t|
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
28 t.pattern = 'test/finder_test.rb'
29 t.verbose = true
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
30 t.env = { 'DB' => configuration }
1d8a065 @mislav Reduce File.dirname cruft: invoke individual tests with -Ilib:test pa…
authored
31 t.libs << 'test'
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
32 end
33 end
34
35 task :test_databases => %w(test_mysql test_sqlite3 test_postgres)
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
36
37 desc %{Test everything on SQLite3, MySQL and PostgreSQL}
38 task :test_full => %w(test test_mysql test_postgres)
39
40 desc %{Test everything with Rails 1.2.x and 2.0.x gems}
41 task :test_all do
42 all = Rake::Task['test_full']
43 ENV['RAILS_VERSION'] = '~>1.2.6'
44 all.invoke
45 # reset the invoked flag
46 %w( test_full test test_mysql test_postgres ).each do |name|
47 Rake::Task[name].instance_variable_set '@already_invoked', false
48 end
49 # do it again
50 ENV['RAILS_VERSION'] = '~>2.0.2'
51 all.invoke
52 end
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
53
0128efd Point users to the Lightouse URL
mislav authored
54 desc 'Generate RDoc documentation for the will_paginate plugin.'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
55 Rake::RDocTask.new(:rdoc) do |rdoc|
9ba306e rdoc changes
chris authored
56 files = ['README', 'LICENSE', 'lib/**/*.rb']
57 rdoc.rdoc_files.add(files)
58 rdoc.main = "README" # page to start on
7ed0b98 more rdoc stuff
chris authored
59 rdoc.title = "will_paginate"
c7ec4a5 Will Paginate docs and contributors
mislav authored
60
61 templates = %w[/Users/chris/ruby/projects/err/rock/template.rb /var/www/rock/template.rb]
62 rdoc.template = templates.find { |t| File.exists? t }
63
9ba306e rdoc changes
chris authored
64 rdoc.rdoc_dir = 'doc' # rdoc output folder
65 rdoc.options << '--inline-source'
138f004 Will Paginate Christmas doc love
mislav authored
66 rdoc.options << '--charset=UTF-8'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
67 end
Something went wrong with that request. Please try again.