gemspec_spec.rb 640 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4
require 'spec_helper'

5
describe BlobViewer::Gemspec do
6 7
  include FakeBlobHelpers

8
  let(:project) { build_stubbed(:project) }
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
  let(:data) do
    <<-SPEC.strip_heredoc
      Gem::Specification.new do |s|
        s.platform    = Gem::Platform::RUBY
        s.name        = "activerecord"
      end
    SPEC
  end
  let(:blob) { fake_blob(path: 'activerecord.gemspec', 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('activerecord')
    end
  end
end