Sha256: ff7d22df84db9c987395e8da4fee2762644ef4b24e97d03260923257983546e3

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require 'pathname'

require 'boot'
require 'mocha/setup'

if ENV['COVERAGE']
  COVERAGE_THRESHOLD = 49
  require 'simplecov'
  require 'simplecov-rcov'
  SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
  SimpleCov.start do
    add_filter '/test/'
    add_group 'lib', 'lib'
  end
  SimpleCov.at_exit do
    SimpleCov.result.format!
    percent = SimpleCov.result.covered_percent
    unless percent >= COVERAGE_THRESHOLD
      puts "Coverage must be above #{COVERAGE_THRESHOLD}%. It is #{"%.2f" % percent}%"
      Kernel.exit(1)
    end
  end
end

require 'geokit'
require 'geokit-rails'

ActiveRecord::Base.send(:include, Geokit::ActsAsMappable::Glue)
ActionController::Base.send(:include, Geokit::GeocoderControl)
ActionController::Base.send(:include, GeoKit::IpGeocodeLookup)

class GeokitTestCase < ActiveSupport::TestCase
  begin
    include ActiveRecord::TestFixtures
  rescue NameError
    puts "You appear to be using a pre-2.3 version of Rails. No need to include ActiveRecord::TestFixtures."
  end
  
  self.fixture_path = (PLUGIN_ROOT + 'test/fixtures').to_s
  self.use_transactional_fixtures = true
  self.use_instantiated_fixtures  = false
  
  fixtures :all 
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geokit-rails-2.0.0 test/test_helper.rb