Sha256: 5c8dd7bce5beb59f1399fb31865811f23d8860e7755ca37355033b373d1c0161

Contents?: true

Size: 1.29 KB

Versions: 8

Compression:

Stored size: 1.29 KB

Contents

require 'simplecov'
SimpleCov.start

require 'minitest/autorun'
require 'minitest/unit'
require 'mocha/minitest'

require 'active_record'
require 'active_support/time'
require 'ndr_support'
require 'tmpdir'

NdrSupport.apply_era_date_formats!

# We do not use Rails' preferred time zone support, as this would
# require all dates to be stored in UTC in the database.
# Thus a birth date of 1975-06-01 would be stored as 1975-05-31 23.00.00.
# Instead, we want to store all times in local time.
if ActiveRecord.respond_to?(:default_timezone=)
  ActiveRecord.default_timezone = :local
else
  ActiveRecord::Base.default_timezone = :local # Rails <= 6.1
end
ActiveRecord::Base.time_zone_aware_attributes = false
Time.zone = 'London'

SafePath.configure! File.dirname(__FILE__) + '/resources/filesystem_paths.yml'

# Borrowed from ActiveSupport::TestCase
module Minitest
  class Test
    # Allow declarive test syntax:
    def self.test(name, &block)
      test_name = "test_#{name.gsub(/\s+/, '_')}".to_sym
      defined = method_defined? test_name
      fail "#{test_name} is already defined in #{self}" if defined
      if block_given?
        define_method(test_name, &block)
      else
        define_method(test_name) do
          flunk "No implementation provided for #{name}"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ndr_support-5.10.3 test/test_helper.rb
ndr_support-5.10.2 test/test_helper.rb
ndr_support-5.10.1 test/test_helper.rb
ndr_support-5.10.0 test/test_helper.rb
ndr_support-5.9.7 test/test_helper.rb
ndr_support-5.9.6 test/test_helper.rb
ndr_support-5.9.5 test/test_helper.rb
ndr_support-5.9.4 test/test_helper.rb