debian-mirror-gitlab/spec/support/factory_default.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
490 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
2021-06-08 01:23:25 +05:30
module Gitlab
module FreezeFactoryDefault
def set_factory_default(name, obj, preserve_traits: nil)
obj.freeze unless obj.frozen?
super
end
end
end
TestProf::FactoryDefault::DefaultSyntax.prepend Gitlab::FreezeFactoryDefault
2020-11-24 15:15:51 +05:30
RSpec.configure do |config|
config.after do |ex|
TestProf::FactoryDefault.reset unless ex.metadata[:factory_default] == :keep
end
config.after(:all) do
TestProf::FactoryDefault.reset
end
end