mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 03:58:49 +01:00
Changes you will need to make: * In your environment.rb, you will need to update references to a few files per environment.rb.tmpl * In your environment.rb, you will need to specify the local time zone of the computer that is running your Tracks install. Other notes on my changes: * Modified our code to take advantage of Rails 2.1's slick time zone support. * Upgraded will_paginate for compatibility * Hacked the Selenium on Rails plugin, which has not been updated in some time and does not support Rails 2.1 * Verified that all tests pass on my machine, including Selenium tests -- I'd like confirmation from others, too.
37 lines
985 B
Ruby
37 lines
985 B
Ruby
require 'test/unit'
|
|
require 'rubygems'
|
|
|
|
# gem install redgreen for colored test output
|
|
begin require 'redgreen'; rescue LoadError; end
|
|
|
|
require 'boot' unless defined?(ActiveRecord)
|
|
|
|
class Test::Unit::TestCase
|
|
protected
|
|
def assert_respond_to_all object, methods
|
|
methods.each do |method|
|
|
[method.to_s, method.to_sym].each { |m| assert_respond_to object, m }
|
|
end
|
|
end
|
|
|
|
def collect_deprecations
|
|
old_behavior = WillPaginate::Deprecation.behavior
|
|
deprecations = []
|
|
WillPaginate::Deprecation.behavior = Proc.new do |message, callstack|
|
|
deprecations << message
|
|
end
|
|
result = yield
|
|
[result, deprecations]
|
|
ensure
|
|
WillPaginate::Deprecation.behavior = old_behavior
|
|
end
|
|
end
|
|
|
|
# Wrap tests that use Mocha and skip if unavailable.
|
|
def uses_mocha(test_name)
|
|
require 'mocha' unless Object.const_defined?(:Mocha)
|
|
rescue LoadError => load_error
|
|
$stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
|
|
else
|
|
yield
|
|
end
|