ENV["RAILS_ENV"] = 'test' require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' class Test::Unit::TestCase # Turn off transactional fixtures if you're working with MyISAM tables in MySQL self.use_transactional_fixtures = false # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david) self.use_instantiated_fixtures = false protected def testing_repository_active? @testing_repository_active ||= if ENABLE_SUBVERSION repos = Repository.new(:name => 'svn_test', :path => 'tmp/svn_test/') begin repos.latest_revision == 7 rescue false end end end def skipped_test_warning warn "Skipped #{name}!\n This test requires the presence of a test repository.\n Please load the test repository fixture into tmp/svn_repos." end end module AttachmentsShouldNotWriteFilesInTestMode def self.included(base) base.send(:include, InstanceMethods) base.send(:alias_method, :write_physical_file, :write_physical_file_on_test) base.send(:alias_method, :delete_physical_file, :delete_physical_file_on_test) end module InstanceMethods def write_physical_file_on_test raise "Cannot write file. #{self.class.name} is not saved yet!" unless physical_filename true end def delete_physical_file_on_test true end end end Attachment.send(:include, AttachmentsShouldNotWriteFilesInTestMode) class FactoryHashcash < ActiveRecord::Base def self.exercise_solved?(params) return true end end module Retrospectiva module ConfigurationManager def self.update_required? false end private def self.load_config {} end def self.save_config(config_hash = nil) end end end