2019-07-07 11:18:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe BlobViewer::ComposerJson do
|
2017-09-10 17:25:29 +05:30
|
|
|
include FakeBlobHelpers
|
|
|
|
|
|
|
|
let(:project) { build_stubbed(:project) }
|
|
|
|
let(:data) do
|
|
|
|
<<-SPEC.strip_heredoc
|
|
|
|
{
|
|
|
|
"name": "laravel/laravel",
|
|
|
|
"homepage": "https://laravel.com/"
|
|
|
|
}
|
|
|
|
SPEC
|
|
|
|
end
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:blob) { fake_blob(path: 'composer.json', data: data) }
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
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
|