summaryrefslogtreecommitdiff
path: root/spec/unit/core/parser_spec.rb
diff options
context:
space:
mode:
authorCan Eldem <eldemcan@users.noreply.github.com>2020-05-18 10:04:25 +0100
committerGitHub <noreply@github.com>2020-05-18 10:04:25 +0100
commitbaa882c452ea6311b4c934ca388e04757c7c436d (patch)
tree2322da54fb505427915c65f296eb1a88afdd533b /spec/unit/core/parser_spec.rb
parent6b392af62854d28b9f12fe292e21b79baa25c63b (diff)
parentf1cbf51f1a185d70c45959c3e2199b29ccbacd1d (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.rb21
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