gitaly.rb 645 Bytes
Newer Older
1 2
RSpec.configure do |config|
  config.before(:each) do |example|
3
    if example.metadata[:disable_gitaly]
4 5
      # 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 }
6 7
    else
      next if example.metadata[:skip_gitaly_mock]
8

9
      # Use 'and_wrap_original' to make sure the arguments are valid
10 11
      allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_wrap_original do |m, *args|
        m.call(*args)
12
        !Gitlab::GitalyClient.explicit_opt_in_required.include?(args.first)
13
      end
14
    end
15 16
  end
end