2017-07-06 12:45:29 +00:00
|
|
|
RSpec.configure do |config|
|
|
|
|
config.before(:each) do |example|
|
2017-11-14 18:53:32 +00:00
|
|
|
if example.metadata[:disable_gitaly]
|
2018-03-28 10:15:30 +00: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 18:53:32 +00:00
|
|
|
else
|
|
|
|
next if example.metadata[:skip_gitaly_mock]
|
2017-11-14 09:02:39 +00:00
|
|
|
|
2018-03-28 10:15:30 +00: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) || true }
|
2017-11-14 18:53:32 +00:00
|
|
|
end
|
2017-03-29 01:23:45 +00:00
|
|
|
end
|
|
|
|
end
|