Welcome to mirror list, hosted at ThFree Co, Russian Federation.

android_target_platform_detector_service_spec.rb « projects « services « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d5feef4ec3da06bd2640657998857ccc9f038009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Projects::AndroidTargetPlatformDetectorService, feature_category: :projects do
  let_it_be(:project) { build(:project) }

  subject { described_class.new(project).execute }

  before do
    allow(Gitlab::FileFinder).to receive(:new) { finder }
  end

  context 'when project is not an Android project' do
    let(:finder) { instance_double(Gitlab::FileFinder, find: []) }

    it { is_expected.to be_nil }
  end

  context 'when project is an Android project' do
    let(:finder) { instance_double(Gitlab::FileFinder) }

    before do
      query = described_class::MANIFEST_FILE_SEARCH_QUERY
      allow(finder).to receive(:find).with(query) { [instance_double(Gitlab::Search::FoundBlob)] }
    end

    it { is_expected.to eq :android }
  end
end