diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/will_paginate/test/tasks.rake | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/will_paginate/test/tasks.rake')
| -rw-r--r-- | vendor/plugins/will_paginate/test/tasks.rake | 59 |
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 59f2f94a..00000000 --- a/vendor/plugins/will_paginate/test/tasks.rake +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | require 'rake/testtask' | ||
| 2 | |||
| 3 | desc 'Test the will_paginate plugin.' | ||
| 4 | Rake::TestTask.new(:test) do |t| | ||
| 5 | t.pattern = 'test/**/*_test.rb' | ||
| 6 | t.verbose = true | ||
| 7 | t.libs << 'test' | ||
| 8 | end | ||
| 9 | |||
| 10 | # I want to specify environment variables at call time | ||
| 11 | class 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 | ||
| 19 | end | ||
| 20 | |||
| 21 | for 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 | ||
| 28 | end | ||
| 29 | |||
| 30 | task :test_databases => %w(test_mysql test_sqlite3 test_postgres) | ||
| 31 | |||
| 32 | desc %{Test everything on SQLite3, MySQL and PostgreSQL} | ||
| 33 | task :test_full => %w(test test_mysql test_postgres) | ||
| 34 | |||
| 35 | desc %{Test everything with Rails 2.1.x, 2.0.x & 1.2.x gems} | ||
| 36 | task :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 | ||
| 44 | end | ||
| 45 | |||
| 46 | def 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 | ||
| 50 | end | ||
| 51 | |||
| 52 | task :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(',')}] | ||
| 59 | end | ||
