Sha256: 91437bbaca33f44c41137746a55ef92151eb2f6d8c3d5ccf0fdf5f9b23f55ffc

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require 'simplecov'
SimpleCov.start

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

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.
ActiveRecord::Base.default_timezone = :local
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

4 entries across 4 versions & 1 rubygems

Version Path
ndr_support-5.4.2 test/test_helper.rb
ndr_support-5.4.1 test/test_helper.rb
ndr_support-5.3.2 test/test_helper.rb
ndr_support-5.3.1 test/test_helper.rb