Sha256: b0ad0b6e710a3a943859b9bf38b9a97a0a9c5deb9a550b5e2cd947c40a81e6e8

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

if ENV['COVERAGE'] == 'true' && RUBY_ENGINE == 'ruby' && RUBY_VERSION == '2.3.1'
  require "simplecov"
  SimpleCov.start do
    add_filter '/spec/'
  end
end

begin
  require 'pry'
  require 'pry-byebug'
rescue LoadError
end

require 'dry-validation'
require 'dry/core/constants'
require 'ostruct'

SPEC_ROOT = Pathname(__dir__)

Dir[SPEC_ROOT.join('shared/**/*.rb')].each(&method(:require))
Dir[SPEC_ROOT.join('support/**/*.rb')].each(&method(:require))

include Dry::Validation

module Types
  include Dry::Types.module
end

Dry::Validation::Deprecations.configure do |config|
  config.logger = Logger.new(SPEC_ROOT.join('../log/deprecations.log'))
end

RSpec.configure do |config|
  config.disable_monkey_patching!
  config.warnings = true

  config.after do
    if defined?(I18n)
      I18n.load_path = Dry::Validation.messages_paths.dup
      I18n.backend.reload!
    end
  end

  config.include PredicatesIntegration

  config.before do
    module Test
      def self.remove_constants
        constants.each { |const| remove_const(const)  }
        self
      end
    end
  end

  config.after do
    Object.send(:remove_const, Test.remove_constants.name)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dry-validation-0.13.1 spec/spec_helper.rb
dry-validation-0.12.3 spec/spec_helper.rb
dry-validation-0.13.0 spec/spec_helper.rb
dry-validation-0.12.2 spec/spec_helper.rb
dry-validation-0.12.1 spec/spec_helper.rb
dry-validation-0.12.0 spec/spec_helper.rb