summaryrefslogtreecommitdiff
path: root/spec/unit/ruby
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-04-13 09:55:40 -0600
committermo khan <mo.khan@gmail.com>2020-04-13 09:55:40 -0600
commitcd399214d15000ffa530042c57e66e7716618d20 (patch)
tree32cc9f8a8c438059178a1ae3da2ac1ab83f2bc0e /spec/unit/ruby
parentb34e0fc20b6567f47e5b733e84f5e7d24ffc0534 (diff)
Parse a Gemfile.lock with multiple dependencies
Diffstat (limited to 'spec/unit/ruby')
-rw-r--r--spec/unit/ruby/parsers/gemfile_lock_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/ruby/parsers/gemfile_lock_spec.rb b/spec/unit/ruby/parsers/gemfile_lock_spec.rb
index ffd9b33..c0c9224 100644
--- a/spec/unit/ruby/parsers/gemfile_lock_spec.rb
+++ b/spec/unit/ruby/parsers/gemfile_lock_spec.rb
@@ -15,5 +15,18 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do
specify { expect(because[0].meta[:platform]).to eql('ruby') }
specify { expect(because[0].meta[:source]).to be_a_kind_of(Bundler::Source) }
end
+
+ context 'when parsing a Gemfile.lock with multiple dependencies' do
+ let(:lockfile) { File.expand_path('./Gemfile.lock') }
+
+ let(:because) { subject.parse(lockfile) }
+ let(:spandx) { because.find { |x| x.name == 'spandx' } }
+
+ specify { expect(spandx.name).to eql('spandx') }
+ specify { expect(spandx.version).to eql(Spandx::VERSION) }
+ specify { expect(spandx.meta[:dependencies].map(&:name)).to match_array(["addressable", "bundler", "net-hippie", "nokogiri", "thor", "zeitwerk"]) }
+ specify { expect(spandx.meta[:platform]).to eql('ruby') }
+ specify { expect(spandx.meta[:source]).to be_a_kind_of(Bundler::Source) }
+ end
end
end