2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-17 12:27:30 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
describe BlobViewer::ComposerJson do
|
2017-05-17 12:27:30 -04:00
|
|
|
include FakeBlobHelpers
|
|
|
|
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { build_stubbed(:project) }
|
2017-05-17 12:27:30 -04:00
|
|
|
let(:data) do
|
|
|
|
<<-SPEC.strip_heredoc
|
|
|
|
{
|
|
|
|
"name": "laravel/laravel",
|
|
|
|
"homepage": "https://laravel.com/"
|
|
|
|
}
|
|
|
|
SPEC
|
|
|
|
end
|
|
|
|
let(:blob) { fake_blob(path: 'composer.json', data: data) }
|
2019-12-18 19:08:01 -05:00
|
|
|
|
2017-05-17 12:27:30 -04:00
|
|
|
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('laravel/laravel')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|