2017-05-17 16:27:30 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 04:13:10 +00:00
|
|
|
describe BlobViewer::ComposerJson do
|
2017-05-17 16:27:30 +00:00
|
|
|
include FakeBlobHelpers
|
|
|
|
|
2017-08-01 18:51:52 +00:00
|
|
|
let(:project) { build_stubbed(:empty_project) }
|
2017-05-17 16:27:30 +00: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) }
|
|
|
|
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
|