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

17 lines
645 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
RSpec.configure do |config|
config.before(:each) do |example|
2018-03-17 18:26:18 +05:30
if example.metadata[:disable_gitaly]
2018-05-09 12:01:36 +05:30
# 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 }
2018-03-17 18:26:18 +05:30
else
next if example.metadata[:skip_gitaly_mock]
2018-05-09 12:01:36 +05:30
# Use 'and_wrap_original' to make sure the arguments are valid
2018-11-08 19:23:39 +05:30
allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_wrap_original do |m, *args|
m.call(*args)
!Gitlab::GitalyClient.explicit_opt_in_required.include?(args.first)
end
2018-03-17 18:26:18 +05:30
end
2017-08-17 22:00:37 +05:30
end
end