Sha256: e1dd92d8feca7649e5939dd33e8a93373e1cd9383b7825562c0c7697136cf327

Contents?: true

Size: 1004 Bytes

Versions: 7

Compression:

Stored size: 1004 Bytes

Contents

if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '3.0'
  require 'simplecov'
  SimpleCov.start
end

require 'rspec'
require 'bogus/rspec'
require 'virtus'

module Virtus
  def self.warn(*)
    # shut up in tests
  end
end

ENV['TZ'] = 'UTC'

# require spec support files and shared behavior
Dir[File.expand_path('../shared/**/*.rb', __FILE__)].each { |file| require file }

RSpec.configure do |config|
  # Remove anonymous- and example- Attribute classes from Attribute descendants
  config.after :all do
    stack = [ Virtus::Attribute ]
    while klass = stack.pop
      klass.descendants.delete_if do |descendant|
        descendant.name.nil? || descendant.name.empty? || descendant.name.start_with?('Examples::')
      end
      stack.concat(klass.descendants)
    end
  end

  # Remove constants in the Example-Module
  config.after :each do
    if defined?(Examples)
      Examples.constants.each do |const_name|
        ConstantsHelpers.undef_constant(Examples, const_name)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/spec/spec_helper.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/spec/spec_helper.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/spec/spec_helper.rb
virtus2-2.1.0 spec/spec_helper.rb
virtus2-2.0.2 spec/spec_helper.rb
virtus2-2.0.1 spec/spec_helper.rb
virtus-2.0.0 spec/spec_helper.rb