2017-07-06 08:45:29 -04:00
|
|
|
RSpec.configure do |config|
|
|
|
|
config.before(:each) do |example|
|
2017-11-14 13:53:32 -05:00
|
|
|
if example.metadata[:disable_gitaly]
|
2018-03-28 06:15:30 -04:00
|
|
|
# Use 'and_wrap_original' to make sure the arguments are valid
|
|
|
|
allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_wrap_original { |m, *args| m.call(*args) && false }
|
2017-11-14 13:53:32 -05:00
|
|
|
else
|
|
|
|
next if example.metadata[:skip_gitaly_mock]
|
2017-11-14 04:02:39 -05:00
|
|
|
|
2018-03-28 06:15:30 -04:00
|
|
|
# Use 'and_wrap_original' to make sure the arguments are valid
|
2018-06-01 07:56:29 -04:00
|
|
|
allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_wrap_original do |m, *args|
|
|
|
|
m.call(*args)
|
2018-06-14 07:18:25 -04:00
|
|
|
!Gitlab::GitalyClient.explicit_opt_in_required.include?(args.first)
|
2018-06-01 07:56:29 -04:00
|
|
|
end
|
2017-11-14 13:53:32 -05:00
|
|
|
end
|
2017-03-28 21:23:45 -04:00
|
|
|
end
|
|
|
|
end
|