main
 1# frozen_string_literal: true
 2
 3RSpec.describe Spandx::Core::Parser do
 4  subject { described_class }
 5
 6  describe '.for' do
 7    describe 'when the `composer.lock` file is empty' do
 8      let(:empty_file) { fixture_file('empty/composer.lock') }
 9      let(:result) { subject.for(empty_file) }
10
11      specify { expect(result).to be(Spandx::Core::Parser::UNKNOWN) }
12    end
13
14    describe 'when the `composer.lock` file is discovered' do
15      let(:lock_file) { fixture_file('composer/composer.lock') }
16      let(:result) { subject.for(lock_file) }
17
18      specify { expect(result).to be_instance_of(Spandx::Php::Parsers::Composer) }
19    end
20  end
21end