summaryrefslogtreecommitdiff
path: root/vendor/plugins/will_paginate/test/tasks.rake
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-27 22:52:50 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-27 22:52:50 +0200
commit9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch)
tree8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /vendor/plugins/will_paginate/test/tasks.rake
parent85a01e35274b8d4d4165a7b26bd7986e211246bb (diff)
parent1853082fcd8c067390c246f9daa01a9b47387497 (diff)
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'vendor/plugins/will_paginate/test/tasks.rake')
-rw-r--r--vendor/plugins/will_paginate/test/tasks.rake59
1 files changed, 0 insertions, 59 deletions
diff --git a/vendor/plugins/will_paginate/test/tasks.rake b/vendor/plugins/will_paginate/test/tasks.rake
deleted file mode 100644
index 59f2f94..0000000
--- a/vendor/plugins/will_paginate/test/tasks.rake
+++ /dev/null
@@ -1,59 +0,0 @@
1require 'rake/testtask'
2
3desc 'Test the will_paginate plugin.'
4Rake::TestTask.new(:test) do |t|
5 t.pattern = 'test/**/*_test.rb'
6 t.verbose = true
7 t.libs << 'test'
8end
9
10# I want to specify environment variables at call time
11class EnvTestTask < Rake::TestTask
12 attr_accessor :env
13
14 def ruby(*args)
15 env.each { |key, value| ENV[key] = value } if env
16 super
17 env.keys.each { |key| ENV.delete key } if env
18 end
19end
20
21for configuration in %w( sqlite3 mysql postgres )
22 EnvTestTask.new("test_#{configuration}") do |t|
23 t.pattern = 'test/finder_test.rb'
24 t.verbose = true
25 t.env = { 'DB' => configuration }
26 t.libs << 'test'
27 end
28end
29
30task :test_databases => %w(test_mysql test_sqlite3 test_postgres)
31
32desc %{Test everything on SQLite3, MySQL and PostgreSQL}
33task :test_full => %w(test test_mysql test_postgres)
34
35desc %{Test everything with Rails 2.1.x, 2.0.x & 1.2.x gems}
36task :test_all do
37 all = Rake::Task['test_full']
38 versions = %w(2.1.0 2.0.4 1.2.6)
39 versions.each do |version|
40 ENV['RAILS_VERSION'] = "~> #{version}"
41 all.invoke
42 reset_invoked unless version == versions.last
43 end
44end
45
46def reset_invoked
47 %w( test_full test test_mysql test_postgres ).each do |name|
48 Rake::Task[name].instance_variable_set '@already_invoked', false
49 end
50end
51
52task :rcov do
53 excludes = %w( lib/will_paginate/named_scope*
54 lib/will_paginate/core_ext.rb
55 lib/will_paginate.rb
56 rails* )
57
58 system %[rcov -Itest:lib test/*.rb -x #{excludes.join(',')}]
59end