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

symbol_uploader_spec.rb « nuget « packages « uploaders « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bdcb5245c1ce495488dadeb9f53f4f0116bdc8cd (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Packages::Nuget::SymbolUploader, feature_category: :package_registry do
  let(:object_storage_key) { 'object/storage/key' }
  let(:symbol) { build_stubbed(:nuget_symbol, object_storage_key: object_storage_key) }

  subject { described_class.new(symbol, :file) }

  describe '#store_dir' do
    it 'uses the object_storage_key' do
      expect(subject.store_dir).to eq(object_storage_key)
    end

    context 'without the object_storage_key' do
      let(:object_storage_key) { nil }

      it 'raises the error' do
        expect { subject.store_dir }
          .to raise_error(
            described_class::ObjectNotReadyError,
            'Packages::Nuget::Symbol model not ready'
          )
      end
    end
  end
end