diff options
| author | Can Eldem <eldemcan@users.noreply.github.com> | 2020-05-18 10:04:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-18 10:04:25 +0100 |
| commit | baa882c452ea6311b4c934ca388e04757c7c436d (patch) | |
| tree | 2322da54fb505427915c65f296eb1a88afdd533b /spec/unit/core/parser_spec.rb | |
| parent | 6b392af62854d28b9f12fe292e21b79baa25c63b (diff) | |
| parent | f1cbf51f1a185d70c45959c3e2199b29ccbacd1d (diff) | |
Merge pull request #20 from spandx/bugs-bunnyv0.13.2
Fix bugs.
Diffstat (limited to 'spec/unit/core/parser_spec.rb')
| -rw-r--r-- | spec/unit/core/parser_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/core/parser_spec.rb b/spec/unit/core/parser_spec.rb new file mode 100644 index 0000000..9ad5bea --- /dev/null +++ b/spec/unit/core/parser_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +RSpec.describe Spandx::Core::Parser do + subject { described_class } + + describe '.for' do + describe 'when the `composer.lock` file is empty' do + let(:empty_file) { fixture_file('empty/composer.lock') } + let(:result) { subject.for(empty_file) } + + specify { expect(result).to be(Spandx::Core::Parser::UNKNOWN) } + end + + describe 'when the `composer.lock` file is discovered' do + let(:lock_file) { fixture_file('composer/composer.lock') } + let(:result) { subject.for(lock_file) } + + specify { expect(result).to be_instance_of(Spandx::Php::Parsers::Composer) } + end + end +end |
