summaryrefslogtreecommitdiff
path: root/spec/models/blob_viewer/podspec_spec.rb
blob: 6c9f0f42d53c441a048c8b6f0b7f728609d005bc (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
require 'spec_helper'

describe BlobViewer::Podspec, model: true do
  include FakeBlobHelpers

  let(:project) { build(:project) }
  let(:data) do
    <<-SPEC.strip_heredoc
      Pod::Spec.new do |spec|
        spec.name         = 'Reachability'
        spec.version      = '3.1.0'
      end
    SPEC
  end
  let(:blob) { fake_blob(path: 'Reachability.podspec', data: data) }
  subject { described_class.new(blob) }

  describe '#package_name' do
    it 'returns the package name' do
      expect(subject).to receive(:prepare!)

      expect(subject.package_name).to eq('Reachability')
    end
  end
end